o
    $x`ÔJ  ã                   @   s@   d Z ddlZG dd„ dejƒZG dd„ deƒZG dd„ dƒZdS )	z" zope.interface.verify unit tests
é    Nc                   @   s4  e Zd ZdZdd„ Zedd„ ƒZdd„ Zdd	„ Zd
d„ Z	dd„ Z
dd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zd d!„ Zd"d#„ Zd$d%„ Zd&d'„ Zd(d)„ Zd*d+„ Zd,d-„ Zd.d/„ Zd0d1„ Zd2d3„ Zd4d5„ Zd6d7„ Zd8d9„ Z d:d;„ Z!d<d=„ Z"d>d?„ Z#d@dA„ Z$dBdC„ Z%dDdE„ Z&dFdG„ Z'dHdI„ Z(dS )JÚTest_verifyClassNc                 C   s   |   ¡ | _d S ©N)Ú_get_FUTÚverifier©Úself© r   úB/usr/lib/python3/dist-packages/zope/interface/tests/test_verify.pyÚsetUp   s   zTest_verifyClass.setUpc                 C   ó   ddl m} |S )Nr   )ÚverifyClass)Úzope.interface.verifyr   )Úclsr   r   r   r	   r      ó   zTest_verifyClass._get_FUTc                 C   s   |S r   r   )r   Úxr   r   r	   Ú<lambda>    ó    zTest_verifyClass.<lambda>c                 K   s   | j ||  |¡fi |¤ŽS r   )r   Ú_adjust_object_before_verify)r   ÚifaceÚklassÚkwargsr   r   r	   Ú_callFUT"   s
   ÿþzTest_verifyClass._callFUTc                 C   sN   ddl m} ddlm} G dd„ d|ƒ}G dd„ dtƒ}|  || j||¡ d S )Nr   ©Ú	Interface©ÚDoesNotImplementc                   @   ó   e Zd ZdS )z>Test_verifyClass.test_class_doesnt_implement.<locals>.ICurrentN©Ú__name__Ú
__module__Ú__qualname__r   r   r   r	   ÚICurrent+   ó    r!   c                   @   r   )z=Test_verifyClass.test_class_doesnt_implement.<locals>.CurrentNr   r   r   r   r	   ÚCurrent.   r"   r#   )Úzope.interfacer   Úzope.interface.exceptionsr   ÚobjectÚassertRaisesr   )r   r   r   r!   r#   r   r   r	   Útest_class_doesnt_implement'   s
   z,Test_verifyClass.test_class_doesnt_implementc                 C   sR   ddl m} ddl m} G dd„ d|ƒ}G dd„ dtƒ}|||ƒ |  ||¡ d S )Nr   r   ©ÚclassImplementsc                   @   r   )zXTest_verifyClass.test_class_doesnt_implement_but_classImplements_later.<locals>.ICurrentNr   r   r   r   r	   r!   7   r"   r!   c                   @   r   )zWTest_verifyClass.test_class_doesnt_implement_but_classImplements_later.<locals>.CurrentNr   r   r   r   r	   r#   :   r"   r#   )r$   r   r*   r&   r   )r   r   r*   r!   r#   r   r   r	   Ú5test_class_doesnt_implement_but_classImplements_later3   s   
zFTest_verifyClass.test_class_doesnt_implement_but_classImplements_laterc                 C   ób   ddl m} ddl m} ddlm} G dd„ d|ƒ}||ƒG dd„ dtƒƒ}|  || j||¡ d S )	Nr   r   ©Úimplementer©ÚBrokenImplementationc                   @   ó   e Zd Zdd„ ZdS )zPTest_verifyClass.test_class_doesnt_have_required_method_simple.<locals>.ICurrentc                   S   ó   d S r   r   r   r   r   r	   ÚmethodG   ó   zWTest_verifyClass.test_class_doesnt_have_required_method_simple.<locals>.ICurrent.methodN©r   r   r    r3   r   r   r   r	   r!   F   ó    r!   c                   @   r   )zOTest_verifyClass.test_class_doesnt_have_required_method_simple.<locals>.CurrentNr   r   r   r   r	   r#   J   ó    r#   ©r$   r   r.   r%   r0   r&   r'   r   ©r   r   r.   r0   r!   r#   r   r   r	   Ú-test_class_doesnt_have_required_method_simpleA   s   ÿz>Test_verifyClass.test_class_doesnt_have_required_method_simplec                 C   óP   ddl m} ddl m} G dd„ d|ƒ}||ƒG dd„ dtƒƒ}|  ||¡ d S )Nr   r   r-   c                   @   r1   )zHTest_verifyClass.test_class_has_required_method_simple.<locals>.ICurrentc                   S   r2   r   r   r   r   r   r	   r3   V   r4   zOTest_verifyClass.test_class_has_required_method_simple.<locals>.ICurrent.methodNr5   r   r   r   r	   r!   U   r6   r!   c                   @   r1   )zGTest_verifyClass.test_class_has_required_method_simple.<locals>.Currentc                 S   ó   t ƒ ‚r   ©ÚNotImplementedErrorr   r   r   r	   r3   \   ó   zNTest_verifyClass.test_class_has_required_method_simple.<locals>.Current.methodNr5   r   r   r   r	   r#   Y   ó    r#   ©r$   r   r.   r&   r   ©r   r   r.   r!   r#   r   r   r	   Ú%test_class_has_required_method_simpleQ   s   z6Test_verifyClass.test_class_has_required_method_simplec                 C   sr   ddl m} ddl m} ddlm} G dd„ d|ƒ}G dd„ d|ƒ}||ƒG d	d
„ d
tƒƒ}|  || j||¡ d S )Nr   r   r-   r/   c                   @   r1   )zNTest_verifyClass.test_class_doesnt_have_required_method_derived.<locals>.IBasec                   S   r2   r   r   r   r   r   r	   r3   g   r4   zUTest_verifyClass.test_class_doesnt_have_required_method_derived.<locals>.IBase.methodNr5   r   r   r   r	   ÚIBasef   r6   rD   c                   @   r   )zQTest_verifyClass.test_class_doesnt_have_required_method_derived.<locals>.IDerivedNr   r   r   r   r	   ÚIDerivedj   r"   rE   c                   @   r   )zPTest_verifyClass.test_class_doesnt_have_required_method_derived.<locals>.CurrentNr   r   r   r   r	   r#   m   r7   r#   r8   )r   r   r.   r0   rD   rE   r#   r   r   r	   Ú.test_class_doesnt_have_required_method_deriveda   s   ÿz?Test_verifyClass.test_class_doesnt_have_required_method_derivedc                 C   s`   ddl m} ddl m} G dd„ d|ƒ}G dd„ d|ƒ}||ƒG dd	„ d	tƒƒ}|  ||¡ d S )
Nr   r   r-   c                   @   r1   )zFTest_verifyClass.test_class_has_required_method_derived.<locals>.IBasec                   S   r2   r   r   r   r   r   r	   r3   y   r4   zMTest_verifyClass.test_class_has_required_method_derived.<locals>.IBase.methodNr5   r   r   r   r	   rD   x   r6   rD   c                   @   r   )zITest_verifyClass.test_class_has_required_method_derived.<locals>.IDerivedNr   r   r   r   r	   rE   |   r"   rE   c                   @   r1   )zHTest_verifyClass.test_class_has_required_method_derived.<locals>.Currentc                 S   r<   r   r=   r   r   r   r	   r3   ‚   r?   zOTest_verifyClass.test_class_has_required_method_derived.<locals>.Current.methodNr5   r   r   r   r	   r#      r@   r#   rA   )r   r   r.   rD   rE   r#   r   r   r	   Ú&test_class_has_required_method_derivedt   s   z7Test_verifyClass.test_class_has_required_method_derivedc                 C   r;   )Nr   r   r-   c                   @   r1   )zKTest_verifyClass.test_method_takes_wrong_arg_names_but_OK.<locals>.ICurrentc                 S   r2   r   r   ©Úar   r   r	   r3   Ž   r4   zRTest_verifyClass.test_method_takes_wrong_arg_names_but_OK.<locals>.ICurrent.methodNr5   r   r   r   r	   r!   Œ   ó    r!   c                   @   r1   )zJTest_verifyClass.test_method_takes_wrong_arg_names_but_OK.<locals>.Currentc                 S   r<   r   r=   )r   Úbr   r   r	   r3   ”   r?   zQTest_verifyClass.test_method_takes_wrong_arg_names_but_OK.<locals>.Current.methodNr5   r   r   r   r	   r#   ‘   r@   r#   rA   rB   r   r   r	   Ú(test_method_takes_wrong_arg_names_but_OK‡   s   z9Test_verifyClass.test_method_takes_wrong_arg_names_but_OKc                 C   r,   )	Nr   r   r-   ©ÚBrokenMethodImplementationc                   @   r1   )zDTest_verifyClass.test_method_takes_not_enough_args.<locals>.ICurrentc                 S   r2   r   r   rH   r   r   r	   r3       r4   zKTest_verifyClass.test_method_takes_not_enough_args.<locals>.ICurrent.methodNr5   r   r   r   r	   r!   ž   rJ   r!   c                   @   r1   )zCTest_verifyClass.test_method_takes_not_enough_args.<locals>.Currentc                 S   r<   r   r=   r   r   r   r	   r3   ¦   r?   zJTest_verifyClass.test_method_takes_not_enough_args.<locals>.Current.methodNr5   r   r   r   r	   r#   £   r@   r#   ©r$   r   r.   r%   rN   r&   r'   r   ©r   r   r.   rN   r!   r#   r   r   r	   Ú!test_method_takes_not_enough_args™   ó   ÿz2Test_verifyClass.test_method_takes_not_enough_argsc                 C   r,   )	Nr   r   r-   rM   c                   @   r1   )zLTest_verifyClass.test_method_doesnt_take_required_starargs.<locals>.ICurrentc                  W   r2   r   r   ©Úargsr   r   r	   r3   ³   r4   zSTest_verifyClass.test_method_doesnt_take_required_starargs.<locals>.ICurrent.methodNr5   r   r   r   r	   r!   ±   rJ   r!   c                   @   r1   )zKTest_verifyClass.test_method_doesnt_take_required_starargs.<locals>.Currentc                 S   r<   r   r=   r   r   r   r	   r3   ¹   r?   zRTest_verifyClass.test_method_doesnt_take_required_starargs.<locals>.Current.methodNr5   r   r   r   r	   r#   ¶   r@   r#   rO   rP   r   r   r	   Ú)test_method_doesnt_take_required_starargs¬   rR   z:Test_verifyClass.test_method_doesnt_take_required_starargsc                 C   r,   )	Nr   r   r-   rM   c                   @   r1   )zOTest_verifyClass.test_method_doesnt_take_required_only_kwargs.<locals>.ICurrentc                  [   r2   r   r   )Úkwr   r   r	   r3   Æ   r4   zVTest_verifyClass.test_method_doesnt_take_required_only_kwargs.<locals>.ICurrent.methodNr5   r   r   r   r	   r!   Ä   rJ   r!   c                   @   r1   )zNTest_verifyClass.test_method_doesnt_take_required_only_kwargs.<locals>.Currentc                 S   r<   r   r=   r   r   r   r	   r3   Ì   r?   zUTest_verifyClass.test_method_doesnt_take_required_only_kwargs.<locals>.Current.methodNr5   r   r   r   r	   r#   É   r@   r#   rO   rP   r   r   r	   Ú,test_method_doesnt_take_required_only_kwargs¿   rR   z=Test_verifyClass.test_method_doesnt_take_required_only_kwargsc                 C   r,   )	Nr   r   r-   rM   c                   @   r1   )z>Test_verifyClass.test_method_takes_extra_arg.<locals>.ICurrentc                 S   r2   r   r   rH   r   r   r	   r3   Ù   r4   zETest_verifyClass.test_method_takes_extra_arg.<locals>.ICurrent.methodNr5   r   r   r   r	   r!   ×   rJ   r!   c                   @   r1   )z=Test_verifyClass.test_method_takes_extra_arg.<locals>.Currentc                 S   r<   r   r=   ©r   rI   rK   r   r   r	   r3   ß   r?   zDTest_verifyClass.test_method_takes_extra_arg.<locals>.Current.methodNr5   r   r   r   r	   r#   Ü   r@   r#   rO   rP   r   r   r	   Útest_method_takes_extra_argÒ   rR   z,Test_verifyClass.test_method_takes_extra_argc                 C   r;   )Nr   r   r-   c                   @   r1   )zKTest_verifyClass.test_method_takes_extra_arg_with_default.<locals>.ICurrentc                 S   r2   r   r   rH   r   r   r	   r3   ë   r4   zRTest_verifyClass.test_method_takes_extra_arg_with_default.<locals>.ICurrent.methodNr5   r   r   r   r	   r!   é   rJ   r!   c                   @   s   e Zd Zddd„ZdS )zJTest_verifyClass.test_method_takes_extra_arg_with_default.<locals>.CurrentNc                 S   r<   r   r=   rX   r   r   r	   r3   ñ   r?   zQTest_verifyClass.test_method_takes_extra_arg_with_default.<locals>.Current.methodr   r5   r   r   r   r	   r#   î   s    r#   rA   rB   r   r   r	   Ú(test_method_takes_extra_arg_with_defaultå   ó   z9Test_verifyClass.test_method_takes_extra_arg_with_defaultc                 C   r;   )Nr   r   r-   c                   @   r1   )zITest_verifyClass.test_method_takes_only_positional_args.<locals>.ICurrentc                 S   r2   r   r   rH   r   r   r	   r3   ü   r4   zPTest_verifyClass.test_method_takes_only_positional_args.<locals>.ICurrent.methodNr5   r   r   r   r	   r!   ú   rJ   r!   c                   @   r1   )zHTest_verifyClass.test_method_takes_only_positional_args.<locals>.Currentc                 W   r<   r   r=   ©r   rT   r   r   r	   r3     r?   zOTest_verifyClass.test_method_takes_only_positional_args.<locals>.Current.methodNr5   r   r   r   r	   r#   ÿ   r@   r#   rA   rB   r   r   r	   Ú&test_method_takes_only_positional_argsö   r[   z7Test_verifyClass.test_method_takes_only_positional_argsc                 C   r,   )	Nr   r   r-   rM   c                   @   r1   )z@Test_verifyClass.test_method_takes_only_kwargs.<locals>.ICurrentc                 S   r2   r   r   rH   r   r   r	   r3     r4   zGTest_verifyClass.test_method_takes_only_kwargs.<locals>.ICurrent.methodNr5   r   r   r   r	   r!     rJ   r!   c                   @   r1   )z?Test_verifyClass.test_method_takes_only_kwargs.<locals>.Currentc                 [   r<   r   r=   ©r   rV   r   r   r	   r3     r?   zFTest_verifyClass.test_method_takes_only_kwargs.<locals>.Current.methodNr5   r   r   r   r	   r#     r@   r#   rO   rP   r   r   r	   Útest_method_takes_only_kwargs  rR   z.Test_verifyClass.test_method_takes_only_kwargsc                 C   r;   )Nr   r   r-   c                   @   r1   )zCTest_verifyClass.test_method_takes_extra_starargs.<locals>.ICurrentc                 S   r2   r   r   rH   r   r   r	   r3      r4   zJTest_verifyClass.test_method_takes_extra_starargs.<locals>.ICurrent.methodNr5   r   r   r   r	   r!     rJ   r!   c                   @   r1   )zBTest_verifyClass.test_method_takes_extra_starargs.<locals>.Currentc                 W   r<   r   r=   ©r   rI   rT   r   r   r	   r3   &  r?   zITest_verifyClass.test_method_takes_extra_starargs.<locals>.Current.methodNr5   r   r   r   r	   r#   #  r@   r#   rA   rB   r   r   r	   Ú test_method_takes_extra_starargs  r[   z1Test_verifyClass.test_method_takes_extra_starargsc                 C   r;   )Nr   r   r-   c                   @   r1   )zNTest_verifyClass.test_method_takes_extra_starargs_and_kwargs.<locals>.ICurrentc                 S   r2   r   r   rH   r   r   r	   r3   1  r4   zUTest_verifyClass.test_method_takes_extra_starargs_and_kwargs.<locals>.ICurrent.methodNr5   r   r   r   r	   r!   /  rJ   r!   c                   @   r1   )zMTest_verifyClass.test_method_takes_extra_starargs_and_kwargs.<locals>.Currentc                 _   r<   r   r=   )r   rI   rT   rV   r   r   r	   r3   7  r?   zTTest_verifyClass.test_method_takes_extra_starargs_and_kwargs.<locals>.Current.methodNr5   r   r   r   r	   r#   4  r@   r#   rA   rB   r   r   r	   Ú+test_method_takes_extra_starargs_and_kwargs+  r[   z<Test_verifyClass.test_method_takes_extra_starargs_and_kwargsc                 C   r,   )	Nr   r   r-   rM   c                   @   r1   )z[Test_verifyClass.test_method_doesnt_take_required_positional_and_starargs.<locals>.ICurrentc                 W   r2   r   r   ©rI   rT   r   r   r	   r3   C  r4   zbTest_verifyClass.test_method_doesnt_take_required_positional_and_starargs.<locals>.ICurrent.methodNr5   r   r   r   r	   r!   A  rJ   r!   c                   @   r1   )zZTest_verifyClass.test_method_doesnt_take_required_positional_and_starargs.<locals>.Currentc                 S   r<   r   r=   ©r   rI   r   r   r	   r3   I  r?   zaTest_verifyClass.test_method_doesnt_take_required_positional_and_starargs.<locals>.Current.methodNr5   r   r   r   r	   r#   F  r@   r#   rO   rP   r   r   r	   Ú8test_method_doesnt_take_required_positional_and_starargs<  rR   zITest_verifyClass.test_method_doesnt_take_required_positional_and_starargsc                 C   r;   )Nr   r   r-   c                   @   r1   )zUTest_verifyClass.test_method_takes_required_positional_and_starargs.<locals>.ICurrentc                 W   r2   r   r   rc   r   r   r	   r3   U  r4   z\Test_verifyClass.test_method_takes_required_positional_and_starargs.<locals>.ICurrent.methodNr5   r   r   r   r	   r!   S  rJ   r!   c                   @   r1   )zTTest_verifyClass.test_method_takes_required_positional_and_starargs.<locals>.Currentc                 W   r<   r   r=   r`   r   r   r	   r3   [  r?   z[Test_verifyClass.test_method_takes_required_positional_and_starargs.<locals>.Current.methodNr5   r   r   r   r	   r#   X  r@   r#   rA   rB   r   r   r	   Ú2test_method_takes_required_positional_and_starargsO  r[   zCTest_verifyClass.test_method_takes_required_positional_and_starargsc                 C   r;   )Nr   r   r-   c                   @   r1   )zBTest_verifyClass.test_method_takes_only_starargs.<locals>.ICurrentc                 W   r2   r   r   rc   r   r   r	   r3   f  r4   zITest_verifyClass.test_method_takes_only_starargs.<locals>.ICurrent.methodNr5   r   r   r   r	   r!   d  rJ   r!   c                   @   r1   )zATest_verifyClass.test_method_takes_only_starargs.<locals>.Currentc                 W   r<   r   r=   r\   r   r   r	   r3   l  r?   zHTest_verifyClass.test_method_takes_only_starargs.<locals>.Current.methodNr5   r   r   r   r	   r#   i  r@   r#   rA   rB   r   r   r	   Útest_method_takes_only_starargs`  r[   z0Test_verifyClass.test_method_takes_only_starargsc                 C   r;   )Nr   r   r-   c                   @   r1   )zDTest_verifyClass.test_method_takes_required_kwargs.<locals>.ICurrentc                  [   r2   r   r   ©r   r   r   r	   r3   w  r4   zKTest_verifyClass.test_method_takes_required_kwargs.<locals>.ICurrent.methodNr5   r   r   r   r	   r!   u  rJ   r!   c                   @   r1   )zCTest_verifyClass.test_method_takes_required_kwargs.<locals>.Currentc                 [   r<   r   r=   r^   r   r   r	   r3   }  r?   zJTest_verifyClass.test_method_takes_required_kwargs.<locals>.Current.methodNr5   r   r   r   r	   r#   z  r@   r#   rA   rB   r   r   r	   Ú!test_method_takes_required_kwargsq  r[   z2Test_verifyClass.test_method_takes_required_kwargsc                 C   r,   )	Nr   r   r-   rM   c                   @   r1   )zVTest_verifyClass.test_method_takes_positional_plus_required_starargs.<locals>.ICurrentc                  W   r2   r   r   rS   r   r   r	   r3   ‰  r4   z]Test_verifyClass.test_method_takes_positional_plus_required_starargs.<locals>.ICurrent.methodNr5   r   r   r   r	   r!   ‡  rJ   r!   c                   @   r1   )zUTest_verifyClass.test_method_takes_positional_plus_required_starargs.<locals>.Currentc                 W   r<   r   r=   r`   r   r   r	   r3   �  r?   z\Test_verifyClass.test_method_takes_positional_plus_required_starargs.<locals>.Current.methodNr5   r   r   r   r	   r#   Œ  r@   r#   rO   rP   r   r   r	   Ú3test_method_takes_positional_plus_required_starargs‚  rR   zDTest_verifyClass.test_method_takes_positional_plus_required_starargsc                 C   r,   )	Nr   r   r-   rM   c                   @   r1   )zJTest_verifyClass.test_method_doesnt_take_required_kwargs.<locals>.ICurrentc                  [   r2   r   r   rh   r   r   r	   r3   �  r4   zQTest_verifyClass.test_method_doesnt_take_required_kwargs.<locals>.ICurrent.methodNr5   r   r   r   r	   r!   ›  rJ   r!   c                   @   r1   )zITest_verifyClass.test_method_doesnt_take_required_kwargs.<locals>.Currentc                 S   r<   r   r=   rd   r   r   r	   r3   £  r?   zPTest_verifyClass.test_method_doesnt_take_required_kwargs.<locals>.Current.methodNr5   r   r   r   r	   r#      r@   r#   rO   rP   r   r   r	   Ú'test_method_doesnt_take_required_kwargs–  rR   z8Test_verifyClass.test_method_doesnt_take_required_kwargsc                    ó^   ddl m‰  ddl m} ddl m} G ‡ fdd„d|ƒ}||ƒG dd„ dƒƒ}|  ||¡ d S )	Nr   ©Ú	Attributer   r-   c                       ó   e Zd Z” dƒZdS )zGTest_verifyClass.test_class_has_method_for_iface_attr.<locals>.ICurrentúThe foo AttributeN©r   r   r    Úattrr   rm   r   r	   r!   ¯  r6   r!   c                   @   r1   )zFTest_verifyClass.test_class_has_method_for_iface_attr.<locals>.Currentc                 S   r<   r   r=   r   r   r   r	   rr   µ  r?   zKTest_verifyClass.test_class_has_method_for_iface_attr.<locals>.Current.attrNrq   r   r   r   r	   r#   ²  r@   r#   ©r$   rn   r   r.   r   rB   r   rm   r	   Ú$test_class_has_method_for_iface_attrª  s   z5Test_verifyClass.test_class_has_method_for_iface_attrc                 C   s`   ddl m} ddl m} ddlm} G dd„ d|ƒ}||ƒG dd„ dƒƒ}|  || j||¡ d S )	Nr   r   r-   rM   c                   @   r1   )zFTest_verifyClass.test_class_has_nonmethod_for_method.<locals>.ICurrentc                   S   r2   r   r   r   r   r   r	   r3   À  r4   zMTest_verifyClass.test_class_has_nonmethod_for_method.<locals>.ICurrent.methodNr5   r   r   r   r	   r!   ¿  r6   r!   c                   @   ó   e Zd ZdZdS )zETest_verifyClass.test_class_has_nonmethod_for_method.<locals>.Currenté   Nr5   r   r   r   r	   r#   Ã  s    r#   )r$   r   r.   r%   rN   r'   r   rP   r   r   r	   Ú#test_class_has_nonmethod_for_methodº  s   ÿz4Test_verifyClass.test_class_has_nonmethod_for_methodc                    rl   )	Nr   rm   r   r-   c                       ro   )zITest_verifyClass.test_class_has_attribute_for_attribute.<locals>.ICurrentrp   Nrq   r   rm   r   r	   r!   Ï  r6   r!   c                   @   ru   )zHTest_verifyClass.test_class_has_attribute_for_attribute.<locals>.Currentrv   Nrq   r   r   r   r	   r#   Ò  s    r#   rs   rB   r   rm   r	   Ú&test_class_has_attribute_for_attributeÊ  s   z7Test_verifyClass.test_class_has_attribute_for_attributec                    rl   )	Nr   rm   r   r-   c                       ro   )zLTest_verifyClass.test_class_misses_attribute_for_attribute.<locals>.ICurrentrp   Nrq   r   rm   r   r	   r!   ß  r6   r!   c                   @   r   )zKTest_verifyClass.test_class_misses_attribute_for_attribute.<locals>.CurrentNr   r   r   r   r	   r#   â  r7   r#   rs   rB   r   rm   r	   Ú)test_class_misses_attribute_for_attributeÙ  s   z:Test_verifyClass.test_class_misses_attribute_for_attributec                    s‚   ddl m} ddlm} ddlm} G dd„ d|ƒ‰G dd„ dtƒ‰ G ‡fd	d
„d
|ƒ}||ƒG ‡ fdd„dƒƒ}|  ||¡ d S )Nr   )ÚMethodr   r-   c                   @   r1   )zETest_verifyClass.test_w_callable_non_func_method.<locals>.QuasiMethodc                 _   r<   r   r=   ©r   rT   rV   r   r   r	   Ú__call__î  r?   zNTest_verifyClass.test_w_callable_non_func_method.<locals>.QuasiMethod.__call__N©r   r   r    r|   r   r   r   r	   ÚQuasiMethodí  r6   r~   c                   @   r1   )zGTest_verifyClass.test_w_callable_non_func_method.<locals>.QuasiCallablec                 _   r<   r   r=   r{   r   r   r	   r|   ò  r?   zPTest_verifyClass.test_w_callable_non_func_method.<locals>.QuasiCallable.__call__Nr}   r   r   r   r	   ÚQuasiCallableñ  r6   r   c                       ro   )zBTest_verifyClass.test_w_callable_non_func_method.<locals>.ICurrentzThis is callableNrq   r   )r~   r   r	   r!   õ  r6   r!   c                       s   e Zd Z” ƒ ZdS )zATest_verifyClass.test_w_callable_non_func_method.<locals>.CurrentNrq   r   )r   r   r	   r#   ø  s    
r#   )Úzope.interface.interfacerz   r$   r   r.   r&   r   )r   rz   r   r.   r!   r#   r   )r   r~   r	   Útest_w_callable_non_func_methodè  s   z0Test_verifyClass.test_w_callable_non_func_methodc                    s\   ddl m} ddl m} dd„ ‰ G dd„ d|ƒ}||ƒG ‡ fdd	„d	tƒƒ}|  ||¡ d S )
Nr   r   r-   c                    s   t ‡ fdd„ƒS )Nc                    s
   ˆ   | ¡S r   )Ú__get__r   ©Úfuncr   r	   r     s   
 zMTest_verifyClass.test_w_decorated_method.<locals>.decorator.<locals>.<lambda>)Úpropertyrƒ   r   rƒ   r	   Ú	decorator  s   z;Test_verifyClass.test_w_decorated_method.<locals>.decoratorc                   @   r1   )z:Test_verifyClass.test_w_decorated_method.<locals>.ICurrentc                 S   r2   r   r   rH   r   r   r	   r3   	  r4   zATest_verifyClass.test_w_decorated_method.<locals>.ICurrent.methodNr5   r   r   r   r	   r!     rJ   r!   c                       s   e Zd Z” dd„ ƒZdS )z9Test_verifyClass.test_w_decorated_method.<locals>.Currentc                 S   r<   r   r=   rd   r   r   r	   r3     s   z@Test_verifyClass.test_w_decorated_method.<locals>.Current.methodNr5   r   ©r†   r   r	   r#     ó    r#   rA   rB   r   r‡   r	   Útest_w_decorated_methodÿ  s   z(Test_verifyClass.test_w_decorated_methodc                 C   ó    ddl m} | j|tdd� d S )Nr   )ÚIFullMappingT©Ú	tentative)Úzope.interface.common.mappingr‹   r   Údict)r   r‹   r   r   r	   Útest_dict_IFullMapping  s   z'Test_verifyClass.test_dict_IFullMappingc                 C   rŠ   )Nr   )Ú	ISequenceTrŒ   )Úzope.interface.common.sequencer‘   r   Úlist)r   r‘   r   r   r	   Útest_list_ISequence  ó   z$Test_verifyClass.test_list_ISequencec                 C   rŠ   )Nr   )ÚIReadSequenceTrŒ   )r’   r–   r   Útuple)r   r–   r   r   r	   Útest_tuple_IReadSequence$  r•   z)Test_verifyClass.test_tuple_IReadSequencec           
      C   s0  ddl m} ddl m} ddl m} ddlm} ddlm} G dd„ d|ƒ}G d	d
„ d
tƒ}|  |¡�}|  	||¡ W d   ƒ n1 sDw   Y  |j
}	|  dt|	jƒ¡ |  |	jd |¡ |  |	jd |¡ |  |	jd |¡ |||ƒ dd„ |_|  |¡� |  	||¡ W d   ƒ d S 1 s‘w   Y  d S )Nr   )ÚMultipleInvalidr   r/   r   r)   c                   @   s   e Zd Zdd„ Zdd„ ZdS )z?Test_verifyClass.test_multiple_invalid.<locals>.ISeveralMethodsc                 S   ó   dS )zMethod 1Nr   ©Úarg1r   r   r	   Úmeth12  r   zETest_verifyClass.test_multiple_invalid.<locals>.ISeveralMethods.meth1c                 S   rš   )zMethod 2Nr   r›   r   r   r	   Úmeth24  r   zETest_verifyClass.test_multiple_invalid.<locals>.ISeveralMethods.meth2N)r   r   r    r�   rž   r   r   r   r	   ÚISeveralMethods1  s    rŸ   c                   @   r   )z>Test_verifyClass.test_multiple_invalid.<locals>.SeveralMethodsNr   r   r   r   r	   ÚSeveralMethods7  r"   r    é   rv   é   c                 S   rš   )NÚHir   )r   rœ   r   r   r	   r   F  r   z8Test_verifyClass.test_multiple_invalid.<locals>.<lambda>)r%   r™   r   r0   r$   r   r*   r&   r'   r   Ú	exceptionÚassertEqualÚlenÚ
exceptionsÚassertIsInstancer�   )
r   r™   r   r0   r   r*   rŸ   r    ÚexcÚexr   r   r	   Útest_multiple_invalid*  s(   ÿ

"ÿz&Test_verifyClass.test_multiple_invalid))r   r   r    r   r
   Úclassmethodr   r   r   r(   r+   r:   rC   rF   rG   rL   rQ   rU   rW   rY   rZ   r]   r_   ra   rb   re   rf   rg   ri   rj   rk   rt   rw   rx   ry   r�   r‰   r�   r”   r˜   r«   r   r   r   r	   r      sN    

r   c                   @   s@   e Zd Zedd„ ƒZdd„ Zdd„ Zdd„ Zd	d
„ Zdd„ Z	dS )ÚTest_verifyObjectc                 C   r   )Nr   ©ÚverifyObject)r   r¯   )r   r¯   r   r   r	   r   M  r   zTest_verifyObject._get_FUTc                 C   s   t |tttƒfƒr|ƒ }|S r   )Ú
isinstanceÚtypeÚOldSkool)r   Útargetr   r   r	   r   R  s   z.Test_verifyObject._adjust_object_before_verifyc                    sp   ddl m‰  ddl m} ddl m} ddlm} G ‡ fdd„d|ƒ}||ƒG dd	„ d	ƒƒ}|  || j||¡ d S )
Nr   rm   r   r-   r/   c                       ro   )zMTest_verifyObject.test_class_misses_attribute_for_attribute.<locals>.ICurrentrp   Nrq   r   rm   r   r	   r!   ^  r6   r!   c                   @   r   )zLTest_verifyObject.test_class_misses_attribute_for_attribute.<locals>.CurrentNr   r   r   r   r	   r#   a  r7   r#   )r$   rn   r   r.   r%   r0   r'   r   r9   r   rm   r	   ry   W  s   ÿz;Test_verifyObject.test_class_misses_attribute_for_attributec                 C   s(   ddl m} ddlm} |  ||¡ d S )Nr   )ÚIDummyModule©Údummy)Úzope.interface.tests.idummyr´   Úzope.interface.testsr¶   r   )r   r´   r¶   r   r   r	   Útest_module_hith  s   z!Test_verifyObject.test_module_hitc                 C   sJ   ddl m} ddlm} ddlm} G dd„ d|ƒ}|  || j||¡ d S )Nr   r   rµ   r   c                   @   r   )z8Test_verifyObject.test_module_miss.<locals>.IDummyModuleNr   r   r   r   r	   r´   t  r"   r´   )r$   r   r¸   r¶   r%   r   r'   r   )r   r   r¶   r   r´   r   r   r	   Útest_module_missn  s   ÿz"Test_verifyObject.test_module_missc                 C   sZ   ddl m} ddl m} ddlm} G dd„ d|ƒ}||ƒG dd„ dtƒƒ}|||ƒ d S )	Nr   r   )Úproviderr®   c                   @   r1   )z>Test_verifyObject.test_staticmethod_hit_on_class.<locals>.IFooc                 S   rš   )zThe bar methodNr   ©rI   rK   r   r   r	   Úbar�  r   zBTest_verifyObject.test_staticmethod_hit_on_class.<locals>.IFoo.barN)r   r   r    r½   r   r   r   r	   ÚIFoo  rJ   r¾   c                   @   s   e Zd Zedd„ ƒZdS )z=Test_verifyObject.test_staticmethod_hit_on_class.<locals>.Fooc                 S   s   t dƒ‚)NzWe're never actually called)ÚAssertionErrorr¼   r   r   r	   r½   ‡  s   zATest_verifyObject.test_staticmethod_hit_on_class.<locals>.Foo.barN)r   r   r    Ústaticmethodr½   r   r   r   r	   ÚFoo„  rˆ   rÁ   )r$   r   r»   r   r¯   r&   )r   r   r»   r¯   r¾   rÁ   r   r   r	   Útest_staticmethod_hit_on_classz  s   z0Test_verifyObject.test_staticmethod_hit_on_classN)
r   r   r    r¬   r   r   ry   r¹   rº   rÂ   r   r   r   r	   r­   K  s    
r­   c                   @   r   )r²   Nr   r   r   r   r	   r²   �  r"   r²   )Ú__doc__ÚunittestÚTestCaser   r­   r²   r   r   r   r	   Ú<module>   s       ;D