HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib/python3/dist-packages/zope/interface/tests/__pycache__/test_interface.cpython-38.pyc
U

ؒ�]k!�@sJdZddlZddlmZe�ZGdd�dej�ZGdd�dej�ZGdd	�d	ej�Z	Gd
d�dej�Z
Gdd
�d
ej�ZGdd�dej�ZGdd�dej�Z
Gdd�dej�ZGdd�dej�ZGdd�dej�ZGdd�de	�ZGdd�de�ZGdd�dej�ZGdd�dej�ZGd d!�d!e�Zd"d#�Zd$d%�ZGd&d'�d'e�ZdS)(zTest Interface implementation
�N)�_skip_under_py3kc@seZdZdd�Zdd�ZdS)�Test_invariantcsTddlm�ddlm}dd��G��fdd�dt�}|�t||d�d�gi�dS)	Nr��	invariant��TAGGED_DATAc_s
t��dS�N��NotImplementedError��args�kw�r�E/usr/lib/python3/dist-packages/zope/interface/tests/test_interface.py�_checksz,Test_invariant.test_w_single.<locals>._checkcseZdZ���dS)z)Test_invariant.test_w_single.<locals>.FooN��__name__�
__module__�__qualname__r�rrrr�Foo!sr�
invariants��zope.interface.interfacerr�object�assertEqual�getattr��selfrrrrr�
test_w_singles�zTest_invariant.test_w_singlecs`ddlm�ddlm}dd��dd��G���fdd	�d	t�}|�t||d�d
��gi�dS)Nrrrc_s
t��dSrr	rrrrr+sz.Test_invariant.test_w_multiple.<locals>._checkc_s
t��dSrr	rrrr�_another_check.sz6Test_invariant.test_w_multiple.<locals>._another_checkcseZdZ������dS)z+Test_invariant.test_w_multiple.<locals>.FooNrr�r rrrrr1srrrrrr!r�test_w_multiple's
�zTest_invariant.test_w_multipleN)rrrrr"rrrrrs
rc@s$eZdZdd�Zdd�Zdd�ZdS)�Test_taggedValuecsJddlm�ddlm}G�fdd�dt�}|�t||d�ddgi�dS)Nr��taggedValuercseZdZ�ddg�dS)z+Test_taggedValue.test_w_single.<locals>.Foo�bar�bazNrrr$rrr?srr&r'�rr%rrrrrrr$rr;s�zTest_taggedValue.test_w_singlecsLddlm�ddlm}G�fdd�dt�}|�t||d�dgdd��dS)	Nrr$rcs"eZdZ�ddg��dd�dS)z-Test_taggedValue.test_w_multiple.<locals>.Foor&r'�qux�spamNrrr$rrrIsrr'r*�r&r)r(rrr$rr"Es
�z Test_taggedValue.test_w_multiplecsJddlm�ddlm}G�fdd�dt�}|�t||d�ddd��dS)	Nrr$rcs,eZdZ�ddg��dd��dd�dS)z9Test_taggedValue.test_w_multiple_overwriting.<locals>.Foor&r'r)r*�frobNrrr$rrrTs
rr,r*r+r(rrr$r�test_w_multiple_overwritingPs�z,Test_taggedValue.test_w_multiple_overwritingN)rrrrr"r-rrrrr#9s
r#c@sReZdZdZdd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�ElementTestsZ	AnElementcCsddlm}|S)Nr)�Element)rr/)rr/rrr�_getTargetClassaszElementTests._getTargetClassNcCs|dkr|j}|��|�Sr)�DEFAULT_NAMEr0)r�namerrr�_makeOneeszElementTests._makeOnecCs`|��}|�|j|j�|�|��|j�|�|jd�|�|��d�|�t|���g�dS)N�)	r3rrr1�getName�__doc__�getDoc�list�getTaggedValueTags�r�elementrrr�test_ctor_defaultsjszElementTests.test_ctor_defaultscCs*|�d�}|�|jd�|�|jd�dS)Nz
An Element)r3rrr6r:rrr�test_ctor_no_doc_space_in_namers
z+ElementTests.test_ctor_no_doc_space_in_namecCs|��}|�t|jd�dS�N�nonesuch)r3�assertRaises�KeyError�getTaggedValuer:rrr�test_getTaggedValue_misswsz%ElementTests.test_getTaggedValue_misscCs|��}|�|�d�d�dSr>�r3r�queryTaggedValuer:rrr�test_queryTaggedValue_miss{sz'ElementTests.test_queryTaggedValue_misscCs |��}|�|�dd�d�dS)Nr?r&rDr:rrr�$test_queryTaggedValue_miss_w_defaultsz1ElementTests.test_queryTaggedValue_miss_w_defaultcCsR|��}|�dd�|�t|���dg�|�|�d�d�|�|�d�d�dS�N�foor&)r3�setTaggedValuerr8r9rBrEr:rrr�test_setTaggedValue�s
z ElementTests.test_setTaggedValue)N)rrrr1r0r3r<r=rCrFrGrKrrrrr.]s
r.c@s\eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)�SpecificationBasePyTestscCsddlm}|S�Nr)�SpecificationBasePy)rrN)rrNrrrr0�sz(SpecificationBasePyTests._getTargetClasscCs
|���Sr�r0�rrrrr3�sz!SpecificationBasePyTests._makeOnec	sZddlm}ddlm�|��}�fdd�}t||d��|�|�t���W5QRXdS)Nr��	interface��_emptycs�Srr��objrSrr�_providedBy�szBSpecificationBasePyTests.test_providedBy_miss.<locals>._providedBy��
providedBy)	�zope.interfacerR�zope.interface.declarationsrTr3�_Monkey�assertFalserYr)rrR�sbrWrrSr�test_providedBy_miss�sz-SpecificationBasePyTests.test_providedBy_missc	sbddlm}|���G�fdd�dt���fdd�}t||d��|���t���W5QRXdS)NrrQcseZdZ�iiZdS)z;SpecificationBasePyTests.test_providedBy_hit.<locals>._DeclN�rrr�_impliedr�r^rr�_Decl�srccs��SrrrU�rcrrrW�szASpecificationBasePyTests.test_providedBy_hit.<locals>._providedByrX)rZrRr3rr\�
assertTruerY)rrRrWr�rcr^r�test_providedBy_hit�sz,SpecificationBasePyTests.test_providedBy_hitc	sZddlm}ddlm�|��}�fdd�}t||d��|�|�t���W5QRXdS)NrrQrScs�SrrrUrSrr�_implementedBy�szHSpecificationBasePyTests.test_implementedBy_miss.<locals>._implementedBy��
implementedBy)	rZrRr[rTr3r\r]rjr)rrRr^rhrrSr�test_implementedBy_miss�sz0SpecificationBasePyTests.test_implementedBy_missc	sbddlm}|���G�fdd�dt���fdd�}t||d��|���t���W5QRXdS)NrrQcseZdZ�iiZdS)z>SpecificationBasePyTests.test_implementedBy_hit.<locals>._DeclNr`rrbrrrc�srccs��SrrrUrdrrrh�szGSpecificationBasePyTests.test_implementedBy_hit.<locals>._implementedByri)rZrRr3rr\rerj)rrRrhrrfr�test_implementedBy_hit�sz/SpecificationBasePyTests.test_implementedBy_hitcCs$|��}i|_|�|�t���dSr�r3rar]ZisOrExtendsr�rr^rrr�test_isOrExtends_miss�sz.SpecificationBasePyTests.test_isOrExtends_misscCs*|��}t�}|ii|_|�||��dSr�r3rrare�rr^Ztestingrrr�test_isOrExtends_hit�s
z-SpecificationBasePyTests.test_isOrExtends_hitcCs$|��}i|_|�|�t���dSrrmrnrrr�test___call___miss�sz+SpecificationBasePyTests.test___call___misscCs*|��}t�}|ii|_|�||��dSrrprqrrr�test___call___hit�s
z*SpecificationBasePyTests.test___call___hitN)
rrrr0r3r_rgrkrlrorrrsrtrrrrrL�s	
	
rLc@seZdZdd�Zdd�ZdS)�SpecificationBaseTestscCsddlm}|S)Nr)�SpecificationBase)rrv)rrvrrrr0�sz&SpecificationBaseTests._getTargetClasscCsRddlm}zddl}Wn$tk
r<|�|��|�YnX|�|��|�dSrM)rrN�-zope.interface._zope_interface_coptimizations�ImportError�assertIsr0�assertIsNot)rrN�zoperrr�test_optimizations�sz)SpecificationBaseTests.test_optimizationsN�rrrr0r|rrrrru�sruc@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�InterfaceBasePyTestscCsddlm}|S�Nr)�InterfaceBasePy)rr�)rr�rrrr0�sz$InterfaceBasePyTests._getTargetClasscsG�fdd�d|���}|�S)Ncs eZdZdd�Z�fdd�ZdS)z)InterfaceBasePyTests._makeOne.<locals>.IBcSs||�Srr)rZconformrrr�
_call_conform�sz7InterfaceBasePyTests._makeOne.<locals>.IB._call_conformcs�Srr)rrV��object_should_providerrrY�sz4InterfaceBasePyTests._makeOne.<locals>.IB.providedByN)rrrr�rYrr�rr�IB�sr�rO)rr�r�rr�rr3�szInterfaceBasePyTests._makeOnecs<|�d�}t��G�fdd�dt�}|�||���k�dS)NFcseZdZ�fdd�ZdS)zRInterfaceBasePyTests.test___call___w___conform___returning_value.<locals>._Adaptedcs�Srr�r�iface�Z	conformedrr�__conform__�sz^InterfaceBasePyTests.test___call___w___conform___returning_value.<locals>._Adapted.__conform__N�rrrr�rr�rr�_Adapted�sr��r3rre)r�ibr�rr�r�+test___call___w___conform___returning_value�s
z@InterfaceBasePyTests.test___call___w___conform___returning_valuecCs6|�d�}Gdd�dt�}|�}|�||�|k�dS)NTc@seZdZdd�ZdS)zSInterfaceBasePyTests.test___call___w___conform___miss_ob_provides.<locals>._AdaptedcSsdSrrr�rrrr��sz_InterfaceBasePyTests.test___call___w___conform___miss_ob_provides.<locals>._Adapted.__conform__Nr�rrrrr��sr�r�)rr�r��adaptedrrr�,test___call___w___conform___miss_ob_provides�s
zAInterfaceBasePyTests.test___call___w___conform___miss_ob_providescCs.|�d�}t�}t�}|�|||�|k�dS�NFr�)rr�r�Z	alternaterrr�7test___call___wo___conform___ob_no_provides_w_alternate�s
zLInterfaceBasePyTests.test___call___wo___conform___ob_no_provides_w_alternatecCs"|�d�}t�}|�t||�dSr�)r3rr@�	TypeError�rr�r�rrr�7test___call___w___conform___ob_no_provides_wo_alternates
zLInterfaceBasePyTests.test___call___w___conform___ob_no_provides_wo_alternatecCs(|�d�}t�}|�|�|�|k�dS�NT)r3rre�	__adapt__r�rrr�test___adapt___ob_provides
s
z/InterfaceBasePyTests.test___adapt___ob_providesc	szddlm}|�d�}t�}g��fdd�}dd�}t|||gd��,|�|�|�|k�|��||fg�W5QRXdS)	NrrQFcs��||f�dSr��append�r�rV�Z_missedrr�
_hook_missszQInterfaceBasePyTests.test___adapt___ob_no_provides_uses_hooks.<locals>._hook_misscSs|Srrr�rrr�	_hook_hitszPInterfaceBasePyTests.test___adapt___ob_no_provides_uses_hooks.<locals>._hook_hit��
adapter_hooks)rZrRr3rr\rer�r)rrRr�r�r�r�rr�r�(test___adapt___ob_no_provides_uses_hookss
z=InterfaceBasePyTests.test___adapt___ob_no_provides_uses_hooksN)rrrr0r3r�r�r�r�r�r�rrrrr~�sr~c@seZdZdd�Zdd�ZdS)�InterfaceBaseTestscCsddlm}|S)Nr)�
InterfaceBase)rr�)rr�rrrr0 sz"InterfaceBaseTests._getTargetClasscCsRddlm}zddl}Wn$tk
r<|�|��|�YnX|�|��|�dSr)rr�rwrxryr0rz)rr�r{rrrr|$sz%InterfaceBaseTests.test_optimizationsNr}rrrrr�sr�c@s�eZdZdd�Zefdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�ZdS) �SpecificationTestscCsddlm}|S)Nr)�
Specification)rr�)rr�rrrr00sz"SpecificationTests._getTargetClasscCs|tkr|���S|��|�Sr)�_markerr0)r�basesrrrr34s
zSpecificationTests._makeOnecCsjddlm}|��}|�|jd�|�t|j�d�|�||jk�|�||jk�|�t|j�d�dS)Nr��	Interfacer�)	rr�r3r�	__bases__�lenrare�
dependents)rr��specrrr�	test_ctor9szSpecificationTests.test_ctorcCs@|��}t�}|�|�|�t|j�d�|�|j|d�dS�N�)r3�DummyDependent�	subscriberr�r��rr��deprrr�test_subscribe_first_timeBs

z,SpecificationTests.test_subscribe_first_timecCs8|��}t�}|�|�|�|�|�|j|d�dS)Nr�)r3r�r�rr�r�rrr�test_subscribe_againIs


z'SpecificationTests.test_subscribe_againcCs"|��}t�}|�t|j|�dSr)r3r�r@rA�unsubscriber�rrr�test_unsubscribe_missPsz(SpecificationTests.test_unsubscribe_misscCs\|��}t�}|�|�|�|�|�|�|�|j|d�|�|�|�||jk�dSr�)r3r�r�r�rr�r]r�rrr�test_unsubscribeUs



z#SpecificationTests.test_unsubscribecCs�ddlm}|��}t�}|�|�Gdd�d|�}Gdd�d|�}|f|_|�|j|g�|�|j|d�|f|_|�|j�	|�d�|�|j|d�dS)Nrr�c@seZdZdS)zVSpecificationTests.test___setBases_subscribes_bases_and_notifies_dependents.<locals>.INrrrrr�Idsr�c@seZdZdS)zVSpecificationTests.test___setBases_subscribes_bases_and_notifies_dependents.<locals>.JNrrrrr�Jfsr�r�)
rr�r3r�r�r�r�_changedr��get)rr�r�r�r�r�rrr�8test___setBases_subscribes_bases_and_notifies_dependents_s
zKSpecificationTests.test___setBases_subscribes_bases_and_notifies_dependentscCshddlm}Gdd�d|�}|��}d|_d|j|<|�|�|�t|d|�|k�|�||jk�dS)Nrr�c@seZdZdS)zGSpecificationTests.test_changed_clears_volatiles_and_implied.<locals>.INrrrrrr�qsr�rr�_v_attrs)	rr�r3r�ra�changedrerr])rr�r�r�rrr�)test_changed_clears_volatiles_and_impliedos

z<SpecificationTests.test_changed_clears_volatiles_and_impliedcCsDddlm}Gdd�d|�}|�||g�}|�t|���|g�dS)Nrr�c@seZdZdS)zCSpecificationTests.test_interfaces_skips_already_seen.<locals>.IFooNrrrrr�IFoo|sr�)rr�r3rr8�
interfaces�rr�r�r�rrr�"test_interfaces_skips_already_seenzsz5SpecificationTests.test_interfaces_skips_already_seencCs>ddlm}Gdd�d|�}|�|�}|�|j|dd��dS)Nrr�c@seZdZdS)z<SpecificationTests.test_extends_strict_wo_self.<locals>.IFooNrrrrrr��sr�T��strict)rr�r3r]�extendsr�rrr�test_extends_strict_wo_self�s
z.SpecificationTests.test_extends_strict_wo_selfcCs |��}|�|j|dd��dS)NTr�)r3r]r��rr�rrr�test_extends_strict_w_self�sz-SpecificationTests.test_extends_strict_w_selfcCs |��}|�|j|dd��dS)NFr�)r3rer�r�rrr�test_extends_non_strict_w_self�sz1SpecificationTests.test_extends_non_strict_w_selfcCs0|��}t�}d|i|_|�|�d�|k�dS)NrI)r3rr�rer�)rr�rIrrr�test_get_hit_w__v_attrs�s
z*SpecificationTests.test_get_hit_w__v_attrscs�ddlm�ddlm}G�fdd�d|�}G�fdd�d|�}|�||g�}|�|�d�|�d�k�|�|�d	�|�d	�k�dS)
Nr��	Attributer�cseZdZ�d�ZdS)zCSpecificationTests.test_get_hit_from_base_wo__v_attrs.<locals>.IFoorIN)rrrrIrr�rrr��sr�cseZdZ�d�ZdS)zCSpecificationTests.test_get_hit_from_base_wo__v_attrs.<locals>.IBarr&N�rrrr&rr�rr�IBar�sr�rIr&)rr�r�r3rer�)rr�r�r�r�rr�r�"test_get_hit_from_base_wo__v_attrs�sz5SpecificationTests.test_get_hit_from_base_wo__v_attrsN)rrrr0r�r3r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr�.s	
r�c@sveZdZdd�Zd^dd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�Zd>d?�Z d@dA�Z!dBdC�Z"dDdE�Z#dFdG�Z$dHdI�Z%dJdK�Z&dLdM�Z'dNdO�Z(dPdQ�Z)dRdS�Z*dTdU�Z+dVdW�Z,dXdY�Z-dZd[�Z.d\d]�Z/dS)_�InterfaceClassTestscCsddlm}|S)Nr��InterfaceClass)rr�)rr�rrrr0�sz#InterfaceClassTests._getTargetClass�ITestrNcCs|��|||||�SrrO)rr2r��attrsr6rrrrr3�szInterfaceClassTests._makeOnecCsN|��}|d�}|�|jd�|�|jd�|�|jd�|�|��d�dS)N�ITestingr4r)r0rrr6r��getBases)r�klass�instrrrr<�sz&InterfaceClassTests.test_ctor_defaultscCs |��}|�t|dt�f�dS)Nr�)r0r@r�r)rr�rrr�test_ctor_bad_bases�sz'InterfaceClassTests.test_ctor_bad_basescCs�ddlm}ddlm}dd�}|dd�||�d�}|��}|d	|d
�}|�|jd	�|�|jd�|�|jd�|�|��|�	��dS)Nrr���fromFunctioncSsdS��	DOCSTRINGNrrrrr�_bar�szBInterfaceClassTests.test_ctor_w_attrs_attrib_methods.<locals>._barrr4�rIr&r��r�r)
rr�r�r0rrr6r��names�keys)rr�r�r��ATTRSr�r�rrr� test_ctor_w_attrs_attrib_methods�s�z4InterfaceClassTests.test_ctor_w_attrs_attrib_methodscCs^dii}|��}|d|d�}|�|jd�|�|jd�|�|jd�|�|��|���dS)NZ
__locals__r�r�r4r�r0rrr6r�r�r��rr�r�r�rrr�test_ctor_attrs_w___locals__�sz0InterfaceClassTests.test_ctor_attrs_w___locals__cCs^dii}|��}|d|d�}|�|jd�|�|jd�|�|jd�|�|��|���dS)N�__annotations__r�r�r4rr�r�rrr�!test_ctor_attrs_w___annotations__�sz5InterfaceClassTests.test_ctor_attrs_w___annotations__cCsjddlm}d|i}|��}|d|d�}|�|jd�|�|jd�|�|jd�|�t|���g�dS)Nr)�_decorator_non_returnZdropmer�r�r4r)	rr�r0rrr6r�r8r�)rr�r�r�r�rrr�'test_ctor_attrs_w__decorator_non_return�sz;InterfaceClassTests.test_ctor_attrs_w__decorator_non_returncCs4ddlm}dt�i}|��}|j||d|d�dS)Nr)�InvalidInterfaceZinvalidr�r�)�zope.interface.exceptionsr�rr0r@)rr�r�r�rrr�#test_ctor_attrs_w_invalid_attr_type�s
z7InterfaceClassTests.test_ctor_attrs_w_invalid_attr_typecCs0ddi}|��}|d|dd�}|�|jd�dS)Nr6ZATTRr�ZEXPLICIT)r�r6)r0rr6r�rrr�test_ctor_w_explicit___doc__�sz0InterfaceClassTests.test_ctor_w_explicit___doc__cCs"|��}|�t|���|g�dSr)r3rr8r�r�rrr�test_interfaces�sz#InterfaceClassTests.test_interfacescCs.|��}|jd|fd�}|�|��|f�dS�NZISub)r�)r3rr��rr��subrrr�
test_getBases�sz!InterfaceClassTests.test_getBasescCs|��}|�|�|��dSr)r3re�isEqualOrExtendedByr�rrr�!test_isEqualOrExtendedBy_identity�sz5InterfaceClassTests.test_isEqualOrExtendedBy_identitycCs<|��}|jd|fd�}|�|�|��|�|�|��dSr�)r3rer�r]r�rrr�!test_isEqualOrExtendedBy_subiface�sz5InterfaceClassTests.test_isEqualOrExtendedBy_subifacecCs8|�d�}|�d�}|�|�|��|�|�|��dS)NZOneZAnother)r3r]r�)r�oneZanotherrrr�"test_isEqualOrExtendedBy_unrelateds

z6InterfaceClassTests.test_isEqualOrExtendedBy_unrelatedcCs�ddlm}ddlm}dd�}|dd�||�d�}d	|d
d�i}|jd|d�}|jd
|f|d�}|�t|jdd��d	g�dS)Nrr�r�cSsdSr�rrrrrr�
szFInterfaceClassTests.test_names_w_all_False_ignores_bases.<locals>._barrr4r�r'�Baz�IBaser��IDerived�r�r�F��all�rr�r�r3r�sortedr��rr�r�r��
BASE_ATTRS�
DERIVED_ATTRS�base�derivedrrr�$test_names_w_all_False_ignores_basess�z8InterfaceClassTests.test_names_w_all_False_ignores_basescCs`ddlm}ddlm}dd�}|dd�||�d�}|j|d	�}|�t|jd
d��dd
g�dS)Nrr�r�cSsdSr�rrrrrr�sz@InterfaceClassTests.test_names_w_all_True_no_bases.<locals>._barrr4r�r�Trr&rIr�rr�r�r�r�r�rrr�test_names_w_all_True_no_basess�z2InterfaceClassTests.test_names_w_all_True_no_basescCs�ddlm}ddlm}dd�}|dd�||�d�}d	|d
d�i}|jd|d�}|jd
|f|d�}|�t|jdd��dd	dg�dS)Nrr�r�cSsdSr�rrrrrr�#szFInterfaceClassTests.test_names_w_all_True_w_bases_simple.<locals>._barrr4r�r'r�r�r�r�rTrr&rIrrrrr�$test_names_w_all_True_w_bases_simple s�z8InterfaceClassTests.test_names_w_all_True_w_bases_simplec	Cs�ddlm}ddlm}dd�}dd�}|dd	�||�d
�}||�|dd	�d�}|jd
|d�}|jd|f|d�}|�t|jdd��dddg�dS)Nrr�r�cSsdSr�rrrrrr�1szJInterfaceClassTests.test_names_w_all_True_bases_w_same_names.<locals>._barcSsdSr�rrrrr�_foo3szJInterfaceClassTests.test_names_w_all_True_bases_w_same_names.<locals>._foorr4r�r��rIr'r�r�r�rTrr&r'rIr�	rr�r�r�rrrrr	rrr�(test_names_w_all_True_bases_w_same_names.s��z<InterfaceClassTests.test_names_w_all_True_bases_w_same_namesc	Cs�ddlm}ddlm}dd�}dd�}|dd	�||�d
�}||�|dd	�d�}|jd
|d�}|jd|f|d�}|�t|�dddg�dS)Nrr�r�cSsdSr�rrrrrr�Bsz/InterfaceClassTests.test___iter__.<locals>._barcSsdSr�rrrrrrDsz/InterfaceClassTests.test___iter__.<locals>._foorr4r�r�rr�r�r�rr&r'rI)rr�r�r3rrrrrr�
test___iter__?s��z!InterfaceClassTests.test___iter__cCs�ddlm}ddlm}dd�}|dd�||�d�}d	|d
d�i}|jd|d�}|jd
|f|d�}|�t|jdd��d	|d	fg�dS)Nrr�r�cSsdSr�rrrrrr�SszUInterfaceClassTests.test_namesAndDescriptions_w_all_False_ignores_bases.<locals>._barrr4r�r'r�r�r�r�rFr�rr�r�r3rr�namesAndDescriptionsrrrr�3test_namesAndDescriptions_w_all_False_ignores_basesPs��zGInterfaceClassTests.test_namesAndDescriptions_w_all_False_ignores_basescCspddlm}ddlm}dd�}|dd�||�d�}|j|d	�}|�t|jd
d��d|dfd
|d
fg�dS)Nrr�r�cSsdSr�rrrrrr�cszOInterfaceClassTests.test_namesAndDescriptions_w_all_True_no_bases.<locals>._barrr4r�r�Frr&rIrrrrr�-test_namesAndDescriptions_w_all_True_no_bases`s�

��zAInterfaceClassTests.test_namesAndDescriptions_w_all_True_no_basescCs�ddlm}ddlm}dd�}|dd�||�d�}d	|d
d�i}|jd|d�}|jd
|f|d�}|�t|jdd��d|dfd	|d	fd|dfg�dS)Nrr�r�cSsdSr�rrrrrr�qszMInterfaceClassTests.test_namesAndDescriptions_w_all_True_simple.<locals>._barrr4r�r'r�r�r�r�rTrr&rIrrrrr�+test_namesAndDescriptions_w_all_True_simplens�


��z?InterfaceClassTests.test_namesAndDescriptions_w_all_True_simplec	Cs�ddlm}ddlm}dd�}dd�}|dd	�||�d
�}||�|dd	�d�}|jd
|d�}|jd|f|d�}|�t|jdd��d|dfd|dfd|dfg�dS)Nrr�r�cSsdSr�rrrrrr��szYInterfaceClassTests.test_namesAndDescriptions_w_all_True_bases_w_same_names.<locals>._barcSsdSr�rrrrrr�szYInterfaceClassTests.test_namesAndDescriptions_w_all_True_bases_w_same_names.<locals>._foorr4r�r�rr�r�r�rTrr&r'rIrrrrr�7test_namesAndDescriptions_w_all_True_bases_w_same_names�s$��


��zKInterfaceClassTests.test_namesAndDescriptions_w_all_True_bases_w_same_namescCs|��}|�t|jd�dSr>)r3r@rA�getDescriptionFor�rr�rrr�test_getDescriptionFor_miss�sz/InterfaceClassTests.test_getDescriptionFor_misscCspddlm}ddlm}dd�}|dd�||�d�}|j|d	�}|�|�d
�|d
�|�|�d�|d�dS)Nrr�r�cSsdSr�rrrrrr��sz<InterfaceClassTests.test_getDescriptionFor_hit.<locals>._barrr4r�r�rIr&)rr�r�r3rrrrrr�test_getDescriptionFor_hit�s�z.InterfaceClassTests.test_getDescriptionFor_hitcs$|����fdd�}|�t|�dS)Ncs�dSr>rr�r�rr�_test�sz8InterfaceClassTests.test___getitem___miss.<locals>._test)r3r@rA)rrrrr�test___getitem___miss�sz)InterfaceClassTests.test___getitem___misscCslddlm}ddlm}dd�}|dd�||�d�}|j|d	�}|�|d
|d
�|�|d|d�dS)Nrr�r�cSsdSr�rrrrrr��sz6InterfaceClassTests.test___getitem___hit.<locals>._barrr4r�r�rIr&)rr�r�r3rrrrr�test___getitem___hit�s�z(InterfaceClassTests.test___getitem___hitcCs|��}|�d|k�dSr>)r3r]rrrr�test___contains___miss�sz*InterfaceClassTests.test___contains___misscCs`ddlm}ddlm}dd�}|dd�||�d�}|j|d	�}|�d
|k�|�d|k�dS)Nrr�r�cSsdSr�rrrrrr��sz7InterfaceClassTests.test___contains___hit.<locals>._barrr4r�r�rIr&)rr�r�r3rerrrr�test___contains___hit�s�z)InterfaceClassTests.test___contains___hitcCs|��}|�|�d�d�dSr>)r3r�directrrrr�test_direct_miss�sz$InterfaceClassTests.test_direct_missc	Cs�ddlm}ddlm}dd�}dd�}|dd	�||�d
�}||�|dd	�d�}|jd
|d�}|jd|f|d�}|�|�d�|d�|�|�d�|d�|�|�d�d�dS)Nrr�r�cSsdSr�rrrrrr��szBInterfaceClassTests.test_direct_hit_local_miss_bases.<locals>._barcSsdSr�rrrrrr�szBInterfaceClassTests.test_direct_hit_local_miss_bases.<locals>._foorr4r�r�rr�r�r�rrIr'r&)rr�r�r3rr#rrrr� test_direct_hit_local_miss_bases�s��z4InterfaceClassTests.test_direct_hit_local_miss_basescCs|��}|�|�d�d�dSr>)r3r�queryDescriptionForr�rrr�test_queryDescriptionFor_miss�sz1InterfaceClassTests.test_queryDescriptionFor_misscCs@ddlm}d|dd�i}|j|d�}|�|�d�|d�dS)Nrr��attrZTitleZDescriptionr�)rZr�r3rr&)rr�r�r�rrr�test_queryDescriptionFor_hit�sz0InterfaceClassTests.test_queryDescriptionFor_hitcsVg��fdd�}|��}t�}|�d|g�|�|�|�d�|��|fifg�dS)Ncs��||f�dSr�r�r�Z_called_withrr�	_passable�szCInterfaceClassTests.test_validateInvariants_pass.<locals>._passabler)r3rrJr�validateInvariants)rr+r�rVrr*r�test_validateInvariants_pass�sz0InterfaceClassTests.test_validateInvariants_passcs�ddlm�g��fdd�}g���fdd�}|��}t�}|�d||g�|��|j|�|��|fifg�|��|fifg�dS)Nr��Invalidcs��||f�dSr�r�r��_passable_called_withrrr+�szTInterfaceClassTests.test_validateInvariants_fail_wo_errors_passed.<locals>._passablecs��||f���dSrr�r�r/�_fail_called_withrr�_fail�szPInterfaceClassTests.test_validateInvariants_fail_wo_errors_passed.<locals>._failr�r�r/r3rrJr@r,r)rr+r4r�rVr�r/r3r1r�-test_validateInvariants_fail_wo_errors_passed�szAInterfaceClassTests.test_validateInvariants_fail_wo_errors_passedcs�ddlm�g}g���fdd�}|��}t�}|�d|g�|��|j||�|��|fifg�|�t|�d�|�	t
|d���dS)Nrr.cs��||f���dSrr�rr2rrr4szOInterfaceClassTests.test_validateInvariants_fail_w_errors_passed.<locals>._failrr��r�r/r3rrJr@r,rr�re�
isinstance)r�_errorsr4r�rVrr2r�,test_validateInvariants_fail_w_errors_passedsz@InterfaceClassTests.test_validateInvariants_fail_w_errors_passedcs�ddlm�g��fdd�}g���fdd�}|�d�}|�d|f�}t�}|�d	|g�|�d	|g�|��|j|�|��|fifg�|��|fifg�dS)
Nrr.cs��||f�dSr�r�rr0rrr+sz\InterfaceClassTests.test_validateInvariants_fail_in_base_wo_errors_passed.<locals>._passablecs��||f���dSrr�rr2rrr4szXInterfaceClassTests.test_validateInvariants_fail_in_base_wo_errors_passed.<locals>._failr�r�rr5)rr+r4rr	rVrr6r�5test_validateInvariants_fail_in_base_wo_errors_passeds
zIInterfaceClassTests.test_validateInvariants_fail_in_base_wo_errors_passedcs�ddlm�g}g��fdd�}g���fdd�}|�d�}|�d|f�}t�}|�d	|g�|�d	|g�|��|j||�|��|fifg�|��|fifg�|�t|�d
�|�	t
|d���dS)Nrr.cs��||f�dSr�r�rr0rrr+*sz[InterfaceClassTests.test_validateInvariants_fail_in_base_w_errors_passed.<locals>._passablecs��||f���dSrr�rr2rrr4.szWInterfaceClassTests.test_validateInvariants_fail_in_base_w_errors_passed.<locals>._failr�r�rr�r8)rr:r+r4rr	rVrr6r�4test_validateInvariants_fail_in_base_w_errors_passed&s 
zHInterfaceClassTests.test_validateInvariants_fail_in_base_w_errors_passedcCs|�d�}|�|��d�dS)NZPickleMe)r3r�
__reduce__r�rrr�test___reduce__<s
z#InterfaceClassTests.test___reduce__cCs"|�d�}|�t|�td��dS)N�HashMe)r@z#zope.interface.tests.test_interface)r3r�hashr�rrr�test___hash___normal@s

�z(InterfaceClassTests.test___hash___normalc	Cs�ddl}ddlm}Gdd�d|���}|�}|dd��Z}|�d�|�t|�d�|�t|�d�|�|djt	k�|�t
|dj�d	�W5QRXdS)
Nr)�catch_warningsc@seZdZdd�ZdS)zIInterfaceClassTests.test___hash___missing_required_attrs.<locals>.DerivedcSsdSrrrPrrr�__init__KszRInterfaceClassTests.test___hash___missing_required_attrs.<locals>.Derived.__init__N�rrrrDrrrr�DerivedJsrFT)�record�alwaysr�z-Hashing uninitialized InterfaceClass instance)�warningsrCr0�simplefilterrrAr�re�category�UserWarning�str�message)rrIrCrFr	Zwarnedrrr�$test___hash___missing_required_attrsFs
�z8InterfaceClassTests.test___hash___missing_required_attrscCs�|��}|�|dk�|�|dk�|�|dk�|�|dk�|�|dk�|�|dk�|�d|k�|�d|k�|�d|k�|�d|k�|�d|k�|�d|k�dSr�r3rer]r�rrr�test_comparison_with_NoneVsz-InterfaceClassTests.test_comparison_with_NonecCs`|��}|�||k�|�||k�|�||k�|�||k�|�||k�|�||k�dSr)r3r]rer�rrr�"test_comparison_with_same_instancefsz6InterfaceClassTests.test_comparison_with_same_instancecCs�|jddd�}|jddd�}|�||k�|�||k�|�||k�|�||k�|�||k�|�||k�|�||k�|�||k�|�||k�|�||k�|�||k�|�||k�dS)NZINamezzope.interface.tests.one)rzzope.interface.tests.otherrP)rr��otherrrr�8test_comparison_with_same_named_instance_in_other_modulepszLInterfaceClassTests.test_comparison_with_same_named_instance_in_other_module)r�rNNN)0rrrr0r3r<r�r�r�r�r�r�r�r�r�r�r�r�r
rr
rrrrrrrrrr r!r"r$r%r'r)r-r7r;r<r=r?rBrOrQrRrTrrrrr��s^�
		

r�c@speZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dEdF�Z%e&dGdH��Z'dIdJ�Z(dKdL�Z)dMdN�Z*dOdP�Z+dQdR�Z,dSdT�Z-dUdV�Z.dWdX�Z/dYS)Z�InterfaceTestscsDddlm}ddlm�G�fdd�d|�}|�|dj|k�dS)Nrr�r�cseZdZ�d�ZdS)z<InterfaceTests.test_attributes_link_to_interface.<locals>.I1�My attrN)rrrr(rr�rr�I1�srWr()rZr�r�rerR�rr�rWrr�r�!test_attributes_link_to_interface�sz0InterfaceTests.test_attributes_link_to_interfacecCs4ddlm}Gdd�d|�}|�|dj|k�dS)Nrr�c@seZdZdd�ZdS)z9InterfaceTests.test_methods_link_to_interface.<locals>.I1cSsdS�zA methodNr)rIr&Zbingorrr�method�sz@InterfaceTests.test_methods_link_to_interface.<locals>.I1.methodN�rrrr[rrrrrW�srWr[)rZr�rerRrXrrr�test_methods_link_to_interface�sz-InterfaceTests.test_methods_link_to_interfacecs�ddlm}ddlm}ddlm}Gdd�d|��Gdd�d|�}G�fd	d
�d
t�}|�}|���|��|�|�|��|��||�k�|�|||�k�|��||�k�|�|||�k�dS)Nrr�rirXc@seZdZdd�Zdd�ZdS)z<InterfaceTests.test_classImplements_simple.<locals>.ICurrentcSsdSrr��a�brrr�method1�szDInterfaceTests.test_classImplements_simple.<locals>.ICurrent.method1cSsdSrrr^rrr�method2�szDInterfaceTests.test_classImplements_simple.<locals>.ICurrent.method2N)rrrrarbrrrr�ICurrent�srcc@seZdZdS)z:InterfaceTests.test_classImplements_simple.<locals>.IOtherNrrrrr�IOther�srdcs eZdZ�Zdd�Zdd�ZdS)z;InterfaceTests.test_classImplements_simple.<locals>.CurrentcSs
t��dSrr	�rr_r`rrrra�szCInterfaceTests.test_classImplements_simple.<locals>.Current.method1cSs
t��dSrr	rerrrrb�szCInterfaceTests.test_classImplements_simple.<locals>.Current.method2N)rrr�__implemented__rarbr�rcrr�Current�srh�rZr�rjrYrrer])rr�rjrYrdrh�currentrrgr�test_classImplements_simple�sz*InterfaceTests.test_classImplements_simplecs�ddlm}ddlm}ddlm}Gdd�d|��Gdd�d��}G�fd	d
�d
�}|�}|���|��|�|�|��|��||�k�|�|||�k�|��||�k�|�|||�k�dS)Nrr�rirXc@seZdZdd�ZdS)zCInterfaceTests.test_classImplements_base_not_derived.<locals>.IBasecSsdSrrrrrrr[�szJInterfaceTests.test_classImplements_base_not_derived.<locals>.IBase.methodNr\rrrrr��sr�c@seZdZdS)zFInterfaceTests.test_classImplements_base_not_derived.<locals>.IDerivedNrrrrrr��sr�cseZdZ�Zdd�ZdS)zEInterfaceTests.test_classImplements_base_not_derived.<locals>.CurrentcSs
t��dSrr	rPrrrr[�szLInterfaceTests.test_classImplements_base_not_derived.<locals>.Current.methodN�rrrrfr[r�r�rrrh�srh)rZr�rjrYrer])rr�rjrYr�rhrjrrmr�%test_classImplements_base_not_derived�sz4InterfaceTests.test_classImplements_base_not_derivedcs�ddlm}ddlm}ddlm}Gdd�d|�}Gdd�d|��G�fd	d
�d
t�}|�}|�|�|��|���|��|�|||�k�|�|||���k�|��||�k�|�|||�k�|�|||���k�|��||�k�dS)Nrr�rirXc@seZdZdd�ZdS)zCInterfaceTests.test_classImplements_base_and_derived.<locals>.IBasecSsdSrrrrrrr[�szJInterfaceTests.test_classImplements_base_and_derived.<locals>.IBase.methodNr\rrrrr��sr�c@seZdZdS)zFInterfaceTests.test_classImplements_base_and_derived.<locals>.IDerivedNrrrrrr��sr�cseZdZ�Zdd�ZdS)zEInterfaceTests.test_classImplements_base_and_derived.<locals>.CurrentcSs
t��dSrr	rPrrrr[�szLInterfaceTests.test_classImplements_base_and_derived.<locals>.Current.methodNrlr�r�rrrh�srh)rZr�rjrYrrer]Z	flattened)rr�rjrYr�rhrjrror�%test_classImplements_base_and_derived�sz4InterfaceTests.test_classImplements_base_and_derivedcs�ddlm}ddlm}ddlm}Gdd�d|��Gdd�d���G�fd	d
�d
t�}G�fdd�dt�}Gd
d�d||�}|�}|���|��|���|��|��||�k�|��||�k�|��||�k�|��||�k�dS)Nrr�rirXc@seZdZdd�ZdS)z;InterfaceTests.test_classImplements_multiple.<locals>.ILeftcSsdSrrrrrrr[�szBInterfaceTests.test_classImplements_multiple.<locals>.ILeft.methodNr\rrrr�ILeft�srqc@seZdZdS)z<InterfaceTests.test_classImplements_multiple.<locals>.IRightNrrrrr�IRight�srrcseZdZ�Zdd�ZdS)z:InterfaceTests.test_classImplements_multiple.<locals>.LeftcSs
t��dSrr	rPrrrr[�szAInterfaceTests.test_classImplements_multiple.<locals>.Left.methodNrlr�rqrr�Left�srtcseZdZ�ZdS)z;InterfaceTests.test_classImplements_multiple.<locals>.RightN�rrrrfr�rrrr�Right�srwc@seZdZdS)z:InterfaceTests.test_classImplements_multiple.<locals>.AmbiNrrrrr�Ambi�srx)rZr�rjrYrre)rr�rjrYrtrwrxZambir)rqrrr�test_classImplements_multiple�sz,InterfaceTests.test_classImplements_multiplecsLddlm}ddlm}ddlm}Gdd�d|��Gdd�d���Gd	d
�d
|��G�fdd�d��G�fd
d�dt�}G�fdd�dt��G��fdd�d�|�}|�}|���|��|���|��|���|��|��||�k�|��||�k�|��||�k�|��||�k�|��||�k�|��||�k�dS)Nrr�rirXc@seZdZdd�ZdS)zPInterfaceTests.test_classImplements_multiple_w_explict_implements.<locals>.ILeftcSsdSrrrrrrr[szWInterfaceTests.test_classImplements_multiple_w_explict_implements.<locals>.ILeft.methodNr\rrrrrqsrqc@seZdZdS)zQInterfaceTests.test_classImplements_multiple_w_explict_implements.<locals>.IRightNrrrrrrrsrrc@seZdZdS)zQInterfaceTests.test_classImplements_multiple_w_explict_implements.<locals>.IOtherNrrrrrrdsrdcseZdZ�Zdd�ZdS)zOInterfaceTests.test_classImplements_multiple_w_explict_implements.<locals>.LeftcSs
t��dSrr	rPrrrr[szVInterfaceTests.test_classImplements_multiple_w_explict_implements.<locals>.Left.methodNrlrrsrrrtsrtcseZdZ�ZdS)zPInterfaceTests.test_classImplements_multiple_w_explict_implements.<locals>.RightNrurrvrrrwsrwcseZdZ�ZdS)zPInterfaceTests.test_classImplements_multiple_w_explict_implements.<locals>.OtherNrur)rdrr�Other"srzcseZdZ�j�jfZdS)zPInterfaceTests.test_classImplements_multiple_w_explict_implements.<locals>.MixedNrur)rtrzrr�Mixed%sr{ri)rr�rjrYrwr{Zmixedr)rqrdrrrtrzr�2test_classImplements_multiple_w_explict_implements	s(zAInterfaceTests.test_classImplements_multiple_w_explict_implementscCs�ddlm}|j}|d�}|d|g�}|d�}|d||g�}|�|�|��|�|�|��|�|�|��|�|�|��|�|�|��|�|�|��|�|�|��dS)Nrr��FunInterface�BarInterface�BobInterface�BazInterface)rZr��	__class__rer�r])rr��newr}r~rr�rrr�testInterfaceExtendsInterface4sz,InterfaceTests.testInterfaceExtendsInterfacecs`ddlm�ddlm}ddlm}G�fdd�d|��G�fdd�dt�}|�|�|��dS)	Nrr�r�)�verifyClasscseZdZ�d�Zdd�ZdS)z1InterfaceTests.test_verifyClass.<locals>.ICheckMerVcSsdSrZrrrrrr[Nsz8InterfaceTests.test_verifyClass.<locals>.ICheckMe.methodN�rrrr(r[rr�rr�ICheckMeKsr�cseZdZ�ZdZdd�ZdS)z0InterfaceTests.test_verifyClass.<locals>.CheckMe�valuecSs
t��dSrr	rPrrrr[Usz7InterfaceTests.test_verifyClass.<locals>.CheckMe.methodN�rrrrfr(r[r�r�rr�CheckMeQsr�)rZr�r��zope.interface.verifyr�rre)rr�r�r�r�r�r�r�test_verifyClassEszInterfaceTests.test_verifyClasscsfddlm�ddlm}ddlm}G�fdd�d|��G�fdd�dt�}|�}|�|�|��dS)	Nrr�r�)�verifyObjectcseZdZ�d�Zdd�ZdS)z2InterfaceTests.test_verifyObject.<locals>.ICheckMerVcSsdSrZrrrrrr[csz9InterfaceTests.test_verifyObject.<locals>.ICheckMe.methodNr�rr�rrr�`sr�cseZdZ�ZdZdd�ZdS)z1InterfaceTests.test_verifyObject.<locals>.CheckMer�cSs
t��dSrr	rPrrrr[jsz8InterfaceTests.test_verifyObject.<locals>.CheckMe.methodNr�rr�rrr�fsr�)rZr�r�r�r�rre)rr�r�r�Zcheck_merr�r�test_verifyObjectZsz InterfaceTests.test_verifyObjectcCs0ddlm}Gdd�d|�}|�|�|��dS)Nrr�c@seZdZdS)zLInterfaceTests.test_interface_object_provides_Interface.<locals>.AnInterfaceNrrrrr�AnInterfacetsr�)rZr�rerY)rr�r�rrr�(test_interface_object_provides_Interfaceqsz7InterfaceTests.test_interface_object_provides_InterfacecsHddlm�ddlm}G�fdd�d|�}|�t|���ddg�dS)Nrr�r�cseZdZ�d�Zdd�ZdS)z1InterfaceTests.test_names_simple.<locals>.ISimplerVcSsdSrrrrrrr[�sz8InterfaceTests.test_names_simple.<locals>.ISimple.methodNr�rr�rr�ISimple~sr�r(r[�rZr�r�rrr��rr�r�rr�r�test_names_simpleysz InterfaceTests.test_names_simplecs~ddlm�ddlm}G�fdd�d|�}G�fdd�d|�}|�t|���dd	d
g�|�t|jdd��d
dd	d
g�dS)Nrr�r�cseZdZ�d�Zdd�ZdS)z0InterfaceTests.test_names_derived.<locals>.IBaserVcSsdSrrrrrrr[�sz7InterfaceTests.test_names_derived.<locals>.IBase.methodNr�rr�rrr��sr�cs$eZdZ�d�Zdd�Zdd�ZdS)z3InterfaceTests.test_names_derived.<locals>.IDerived�My attr2cSsdSrrrrrrr[�sz:InterfaceTests.test_names_derived.<locals>.IDerived.methodcSsdSrrrrrrrb�sz;InterfaceTests.test_names_derived.<locals>.IDerived.method2N�rrr�attr2r[rbrr�rrr��sr�r�r[rbTrr(r��rr�r�r�rr�r�test_names_derived�s	�
�z!InterfaceTests.test_names_derivedcsddlm�ddlm}ddlm}G�fdd�d|�}t|���}|�t|�d�|�|ddd�|�	t
|dd	���|�|dd	jd�|�|dd	jd
�|�|d	dd�|�	t
|d	d	|��|�|d	d	jd�|�|d	d	jd�dS)
Nrr���Methodr�cseZdZ�d�Zdd�ZdS)z@InterfaceTests.test_namesAndDescriptions_simple.<locals>.ISimplerVcSsdS��	My methodNrrrrrr[�szGInterfaceTests.test_namesAndDescriptions_simple.<locals>.ISimple.methodNr�rr�rrr��sr�r�r(r�rVr[r�)
rZr�rr�r�rrrr�rer9rr6)rr�r�r��name_valuesrr�r� test_namesAndDescriptions_simple�sz/InterfaceTests.test_namesAndDescriptions_simplecs�ddlm�ddlm}ddlm}G�fdd�d|�}G�fdd�d|�}t|���}|�t|�d	�|�|ddd
�|�	t
|dd���|�|ddjd
�|�|ddjd�|�|ddd
�|�	t
|dd|��|�|ddjd
�|�|ddjd�|�|ddd�|�	t
|dd|��|�|ddjd�|�|ddjd�t|jdd��}|�t|�d�|�|ddd�|�	t
|dd���|�|ddjd�|�|ddjd�|�|ddd
�|�	t
|dd���|�|ddjd
�|�|ddjd�|�|ddd
�|�	t
|dd|��|�|ddjd
�|�|ddjd�|�|d	dd�|�	t
|d	d|��|�|d	djd�|�|d	djd�dS)Nrr�r�r�cseZdZ�d�Zdd�ZdS)z?InterfaceTests.test_namesAndDescriptions_derived.<locals>.IBaserVcSsdSr�rrrrrr[�szFInterfaceTests.test_namesAndDescriptions_derived.<locals>.IBase.methodNr�rr�rrr��sr�cs$eZdZ�d�Zdd�Zdd�ZdS)zBInterfaceTests.test_namesAndDescriptions_derived.<locals>.IDerivedr�cSsdS��My method, overriddenNrrrrrr[�szIInterfaceTests.test_namesAndDescriptions_derived.<locals>.IDerived.methodcSsdS��
My method2Nrrrrrrb�szJInterfaceTests.test_namesAndDescriptions_derived.<locals>.IDerived.method2Nr�rr�rrr��sr��r�r�r�r[r�r�rbr�Tr�r(rV)
rZr�r�rr�rrrr�rer9rr6)rr�r�r�r�r�rr�r�!test_namesAndDescriptions_derived�sJ	z0InterfaceTests.test_namesAndDescriptions_derivedcCs0ddlm}Gdd�d|�}|�t|jd�dS)Nrr�c@seZdZdS)zIInterfaceTests.test_getDescriptionFor_nonesuch_no_default.<locals>.IEmptyNrrrrr�IEmpty�sr�r?)rZr�r@rAr�rr�r�rrr�*test_getDescriptionFor_nonesuch_no_default�sz9InterfaceTests.test_getDescriptionFor_nonesuch_no_defaultcs�ddlm�ddlm}ddlm}G�fdd�d|�}|�d�}|�t|���|�|j	d�|�|j
d�|�d	�}|�t||��|�|j	d	�|�|j
d
�dS)Nrr�r�r�cseZdZ�d�Zdd�ZdS)z=InterfaceTests.test_getDescriptionFor_simple.<locals>.ISimplerVcSsdSr�rrrrrr[szDInterfaceTests.test_getDescriptionFor_simple.<locals>.ISimple.methodNr�rr�rrr��sr�r(rVr[r��rZr�rr�r�rrer9rrr6�rr�r�r��a_desc�m_descrr�r�test_getDescriptionFor_simple�s

z,InterfaceTests.test_getDescriptionFor_simplec	s(ddlm�ddlm}ddlm}G�fdd�d|�}G�fdd�d|�}|�d	�}|�t|���|�|j	d	�|�|j
d
�|�d�}|�t||��|�|j	d�|�|j
d�|�d
�}|�t|���|�|j	d
�|�|j
d�|�d�}|�t||��|�|j	d�|�|j
d�dS)Nrr�r�r�cseZdZ�d�Zdd�ZdS)z<InterfaceTests.test_getDescriptionFor_derived.<locals>.IBaserVcSsdSr�rrrrrr[szCInterfaceTests.test_getDescriptionFor_derived.<locals>.IBase.methodNr�rr�rrr�sr�cs$eZdZ�d�Zdd�Zdd�ZdS)z?InterfaceTests.test_getDescriptionFor_derived.<locals>.IDerivedr�cSsdSr�rrrrrr[szFInterfaceTests.test_getDescriptionFor_derived.<locals>.IDerived.methodcSsdSr�rrrrrrb szGInterfaceTests.test_getDescriptionFor_derived.<locals>.IDerived.method2Nr�rr�rrr�sr�r(rVr[r�r�r�rbr�r��	rr�r�r�r�r�r�Za2_descZm2_descrr�r�test_getDescriptionFor_deriveds*	



z-InterfaceTests.test_getDescriptionFor_derivedcCs0ddlm}Gdd�d|�}|�t|jd�dS)Nrr�c@seZdZdS)z7InterfaceTests.test___getitem__nonesuch.<locals>.IEmptyNrrrrrr�:sr�r?)rZr�r@rA�__getitem__r�rrr�test___getitem__nonesuch7sz'InterfaceTests.test___getitem__nonesuchcs�ddlm�ddlm}ddlm}G�fdd�d|�}|d}|�t|���|�|jd�|�|j	d�|d	}|�t||��|�|jd	�|�|j	d
�dS)Nrr�r�r�cseZdZ�d�Zdd�ZdS)z6InterfaceTests.test___getitem__simple.<locals>.ISimplerVcSsdSr�rrrrrr[Hsz=InterfaceTests.test___getitem__simple.<locals>.ISimple.methodNr�rr�rrr�Esr�r(rVr[r��
rZr�rr�r�rer9rrr6r�rr�r�test___getitem__simple?sz%InterfaceTests.test___getitem__simplec	s ddlm�ddlm}ddlm}G�fdd�d|�}G�fdd�d|�}|d	}|�t|���|�|jd	�|�|j	d
�|d}|�t||��|�|jd�|�|j	d�|d
}|�t|���|�|jd
�|�|j	d�|d}|�t||��|�|jd�|�|j	d�dS)Nrr�r�r�cseZdZ�d�Zdd�ZdS)z6InterfaceTests.test___getitem___derived.<locals>.IBaserVcSsdSr�rrrrrr[^sz=InterfaceTests.test___getitem___derived.<locals>.IBase.methodNr�rr�rrr�[sr�cs$eZdZ�d�Zdd�Zdd�ZdS)z9InterfaceTests.test___getitem___derived.<locals>.IDerivedr�cSsdSr�rrrrrr[dsz@InterfaceTests.test___getitem___derived.<locals>.IDerived.methodcSsdSr�rrrrrrbgszAInterfaceTests.test___getitem___derived.<locals>.IDerived.method2Nr�rr�rrr�asr�r(rVr[r�r�r�rbr�r�r�rr�r�test___getitem___derivedUs*	z'InterfaceTests.test___getitem___derivedcCs.ddlm}Gdd�d|�}|�d|k�dS)Nrr�c@seZdZdS)z8InterfaceTests.test___contains__nonesuch.<locals>.IEmptyNrrrrrr��sr�r?)rZr�r]r�rrr�test___contains__nonesuch~sz(InterfaceTests.test___contains__nonesuchcsLddlm�ddlm}G�fdd�d|�}|�d|k�|�d|k�dS)Nrr�r�cseZdZ�d�Zdd�ZdS)z7InterfaceTests.test___contains__simple.<locals>.ISimplerVcSsdSr�rrrrrr[�sz>InterfaceTests.test___contains__simple.<locals>.ISimple.methodNr�rr�rrr��sr�r(r[�rZr�r�rer�rr�r�test___contains__simple�s
z&InterfaceTests.test___contains__simplecs|ddlm�ddlm}G�fdd�d|�}G�fdd�d|�}|�d|k�|�d	|k�|�d
|k�|�d|k�dS)Nrr�r�cseZdZ�d�Zdd�ZdS)z6InterfaceTests.test___contains__derived.<locals>.IBaserVcSsdSr�rrrrrr[�sz=InterfaceTests.test___contains__derived.<locals>.IBase.methodNr�rr�rrr��sr�cs$eZdZ�d�Zdd�Zdd�ZdS)z9InterfaceTests.test___contains__derived.<locals>.IDerivedr�cSsdSr�rrrrrr[�sz@InterfaceTests.test___contains__derived.<locals>.IDerived.methodcSsdSr�rrrrrrb�szAInterfaceTests.test___contains__derived.<locals>.IDerived.method2Nr�rr�rrr��sr�r(r[r�rbr�r�rr�r�test___contains__derived�s	z'InterfaceTests.test___contains__derivedcCs0ddlm}Gdd�d|�}|�t|�g�dS)Nrr�c@seZdZdS)z1InterfaceTests.test___iter__empty.<locals>.IEmptyNrrrrrr��sr�)rZr�rr8r�rrr�test___iter__empty�sz!InterfaceTests.test___iter__emptycsHddlm�ddlm}G�fdd�d|�}|�tt|��ddg�dS)Nrr�r�cseZdZ�d�Zdd�ZdS)z3InterfaceTests.test___iter__simple.<locals>.ISimplerVcSsdSr�rrrrrr[�sz:InterfaceTests.test___iter__simple.<locals>.ISimple.methodNr�rr�rrr��sr�r(r[�rZr�r�rrr8r�rr�r�test___iter__simple�sz"InterfaceTests.test___iter__simplecs`ddlm�ddlm}G�fdd�d|�}G�fdd�d|�}|�tt|��dd	d
dg�dS)Nrr�r�cseZdZ�d�Zdd�ZdS)z2InterfaceTests.test___iter__derived.<locals>.IBaserVcSsdSr�rrrrrr[�sz9InterfaceTests.test___iter__derived.<locals>.IBase.methodNr�rr�rrr��sr�cs$eZdZ�d�Zdd�Zdd�ZdS)z5InterfaceTests.test___iter__derived.<locals>.IDerivedr�cSsdSr�rrrrrr[�sz<InterfaceTests.test___iter__derived.<locals>.IDerived.methodcSsdSr�rrrrrrb�sz=InterfaceTests.test___iter__derived.<locals>.IDerived.method2Nr�rr�rrr��sr�r(r�r[rbr�r�rr�r�test___iter__derived�s	
�z#InterfaceTests.test___iter__derivedcCs:ddlm}Gdd�d|�}|d}|�|�d�d�dS)Nrr�c@seZdZdd�Zde_dS)zLInterfaceTests.test_function_attributes_become_tagged_values.<locals>.ITagMecSsdSrrrrrrr[�szSInterfaceTests.test_function_attributes_become_tagged_values.<locals>.ITagMe.methodr�N)rrrr[�optionalrrrr�ITagMe�sr�r[r�r�)rZr�rrB)rr�r�r[rrr�-test_function_attributes_become_tagged_values�sz<InterfaceTests.test_function_attributes_become_tagged_valuescCs>ddlm}Gdd�d|�}|�|jd�|�t|�g�dS)Nrr�c@seZdZdZdS)z@InterfaceTests.test___doc___non_element.<locals>.IHaveADocString�xxxN�rrrr6rrrr�IHaveADocString�sr�r�)rZr�rr6r8�rr�r�rrr�test___doc___non_element�sz'InterfaceTests.test___doc___non_elementcsPddlm�ddlm}G�fdd�d|�}|�|jd�|�t|�dg�dS)Nrr�r�cseZdZdZ�d�ZdS)z?InterfaceTests.test___doc___as_element.<locals>.IHaveADocStringr��the docNr�rr�rrr��sr�r4r6)rZr�r�rr6r8r�rr�r�test___doc___as_element�s
z&InterfaceTests.test___doc___as_elementc

Cs�ddlm}|�||j|�g}z|�||�|�d�Wn4|k
rn}z|�|jd|�W5d}~XYnX|�t|�|�dd�|D�}|��|D]}	|�|	|�	d��q�dS)Nrr.z&validateInvariants should always raisecSsg|]}|jd�qS)r�r)�.0�errorrrr�
<listcomp>sz/InterfaceTests._errorsEqual.<locals>.<listcomp>)
r�r/r@r,�failrrr��sort�pop)
r�
has_invariantZ	error_lenZ
error_msgsr�r/�er�Zmsgs�msgrrr�_errorsEqual�s$zInterfaceTests._errorsEqualcs�ddlm�ddlm}ddlm}ddlm�G��fdd�d|�}Gdd	�d	t�}|�}|||�|�|�d
�tg�|�|�	|�d�d|_
|�|�	|�d�d|_|�|�	|�d�|`
|�|d
dg|�dS)Nrr�r���directlyProvidesrcs$eZdZ�d�Z�d�Z�e�dS)z8InterfaceTests.test_invariant_simple.<locals>.IInvariantrI�*bar; must eval to Boolean True if foo doesN�rrrrIr&�
_ifFooThenBarr�r�rrr�
IInvariantsr�c@seZdZdS)z:InterfaceTests.test_invariant_simple.<locals>.HasInvariantNrrrrr�HasInvariantsr�r��*r��If Foo, then Bar!)
rZr�r�r�rrrrBr�r,r&rIr�)rr�r�r�r�r�rr�r�test_invariant_simples(
��z$InterfaceTests.test_invariant_simplecsddlm�ddlm}ddlm}ddlm�G��fdd�d|�}G�fdd	�d	|�}Gd
d�dt�}|�|�d�tg�|�}|||�d
|_	|�
|ddg|�d|_	d|_|�
|ddg|�d|_	d|_|�
|dddg|�d|_	d|_|�|�|�d�dS)Nrr�r�r�rcs$eZdZ�d�Z�d�Z�e�dS)z8InterfaceTests.test_invariant_nested.<locals>.IInvariantrIr�Nr�rr�rrr�,sr�cseZdZ�e�dS)z;InterfaceTests.test_invariant_nested.<locals>.ISubInvariantN)rrr�_barGreaterThanFoorrrr�
ISubInvariant1sr�c@seZdZdS)z:InterfaceTests.test_invariant_nested.<locals>.HasInvariantNrrrrrr�4sr�rr�r�r�r��%Please, Boo MUST be greater than Foo!)
rZr�r�r�rrrrBr�rIr�r&r,)rr�r�r�r�r�r�rr�r�test_invariant_nested&sB�
����z$InterfaceTests.test_invariant_nestedcsddlm�ddlm}ddlm}ddlm�G��fdd�d|�}Gdd	�d	t�}|�}|||�d
|_|�d�}|dd�}|�t	�|�
d|�|�|dd
g|�d|_d|_|�|ddg|�d|_d|_|�|dd
dg|�d|_d|_|�
|�|�d�|�
d|�dS)Nrr�r�r�rcs$eZdZ�d�Z�d�Z�e�dS)z:InterfaceTests.test_invariant_mutandis.<locals>.IInvariantrIr�Nr�rr�rrr�[sr�c@seZdZdS)z<InterfaceTests.test_invariant_mutandis.<locals>.HasInvariantNrrrrrr�`sr�r�rr�r�r�r�)rZr�r�r�rrrIrBr�r�rJr�r&rr,)rr�r�r�r�r�Zold_invariantsrrr�r�test_invariant_mutandisUsD


����z&InterfaceTests.test_invariant_mutandiscs~ddlm}ddlm�Gdd�d|�}|�|jd�|�t|�g�G�fdd�d|�}|�|jd�|�t|�d	g�dS)
Nrr�r�c@seZdZdZdS)�.InterfaceTests.test___doc___element.<locals>.Ir�Nr�rrrrr��sr�r�cseZdZdZ�d�ZdS)r�r�r�Nr�rr�rrr��sr4r6)rZr�r�rr6r8)rr�r�rr�r�test___doc___element�sz#InterfaceTests.test___doc___elementcCsFddl}ddlm}Gdd�d|�}Gdd�d�}|�t|j|�dS)Nrr�c@seZdZdZdS)z&InterfaceTests.testIssue228.<locals>.Ir�Nr�rrrrr��sr�c@seZdZdZdS)z-InterfaceTests.testIssue228.<locals>.OldStyleN)rrrZ__providedBy__rrrr�OldStyle�sr�)�sysrZr�r@�AttributeErrorrY)rr�r�r�r�rrr�testIssue228�s
zInterfaceTests.testIssue228c
s�ddlm}ddlm�ddlm}ddlm�ddlm�G���fdd�d|�}||�Gd	d
�d
t��}|�|dd��|�|dd��z|�|dd��Wn2�k
r�}z|�	t
|�d
�W5d}~XYnXdS)Nrr�r���implementerrr.cs,eZdZ�d�Z�d�Z��fdd��ZdS)z:InterfaceTests.test_invariant_as_decorator.<locals>.IRangezLower boundzUpper boundcs|j|jkr�d��dS)N�	max < min)�max�min)�obr.rr�range_invariant�szJInterfaceTests.test_invariant_as_decorator.<locals>.IRange.range_invariantN)rrrr�r�r�r�r�r/rrr�IRange�sr�c@seZdZdd�ZdS)z9InterfaceTests.test_invariant_as_decorator.<locals>.RangecSs|||_|_dSr)r�r�)rr�r�rrrrD�szBInterfaceTests.test_invariant_as_decorator.<locals>.Range.__init__NrErrrr�Range�sr�r�r�r�)rZr�r�r�rr�r/rr,rrM)rr�r�r�r�r�rr�r�test_invariant_as_decorator�s	z*InterfaceTests.test_invariant_as_decoratorcs�ddlm�ddlm}ddlm�G��fdd�d|�}G�fdd�d|�}Gd	d
�d
|�}|�|�d�d�|�t|jd
�|�|��dg�|�|�d�d�|�|�d
�d�|�t	|���t	dd
g��dS)Nrr�r�r$cs&eZdZ�d�Z�d�Z�dd�dS)z0InterfaceTests.test_taggedValue.<locals>.ITaggedrIr�r)�SpamN)rrrrIr&r�r�r%rr�ITagged�sr�cs eZdZ�dd��dd�dS)z1InterfaceTests.test_taggedValue.<locals>.IDerivedr)�	Spam SpamrIr&Nrrr$rrr��s
r�c@seZdZdS)z2InterfaceTests.test_taggedValue.<locals>.IDerived2Nrrrrr�	IDerived2�sr�r)r�rIr�r&)
rZr�r�r%rrBr@rAr9�set)rr�r�r�r�rr�r�test_taggedValue�szInterfaceTests.test_taggedValuecs�ddlm}ddlm�G�fdd�d|�}Gdd�d|�}Gdd	�d	|�}|�|�d
�|�d
�k�|f|_|�|�d
�dk�dS)Nrr�r�cseZdZ�d�ZdS)z<InterfaceTests.test_description_cache_management.<locals>.I1r_N)rrrr_rr�rrrW�srWc@seZdZdS)z<InterfaceTests.test_description_cache_management.<locals>.I2Nrrrrr�I2�sr�c@seZdZdS)z<InterfaceTests.test_description_cache_management.<locals>.I3Nrrrrr�I3�sr�r_)rZr�r�rer�r�)rr�rWr�r�rr�r�!test_description_cache_management�sz0InterfaceTests.test_description_cache_managementcCsVddlm}ddlm}Gdd�d|�}||�Gdd�dt��}|�||��d�dS)Nrr�r�c@seZdZdS)z>InterfaceTests.test___call___defers_to___conform___.<locals>.INrrrrrr��sr�c@seZdZdd�ZdS)z>InterfaceTests.test___call___defers_to___conform___.<locals>.CcSsdS)Nrr)r�protorrrr�szJInterfaceTests.test___call___defers_to___conform___.<locals>.C.__conform__Nr�rrrr�C�sr)rZr�r�rr)rr�r�r�rrrr�$test___call___defers_to___conform___�sz3InterfaceTests.test___call___defers_to___conform___cCs\ddlm}ddlm}Gdd�d|�}||�Gdd�dt��}|�}|�||�|k�dS)Nrr�r�c@seZdZdS)z9InterfaceTests.test___call___object_implements.<locals>.INrrrrrr�	sr�c@seZdZdS)z9InterfaceTests.test___call___object_implements.<locals>.CNrrrrrrsr)rZr�r�rre)rr�r�r�r�crrr�test___call___object_implementssz.InterfaceTests.test___call___object_implementscCsDddlm}Gdd�d|�}Gdd�dt�}|�}|�t||�dS)Nrr�c@seZdZdS)z9InterfaceTests.test___call___miss_wo_alternate.<locals>.INrrrrrr�sr�c@seZdZdS)z9InterfaceTests.test___call___miss_wo_alternate.<locals>.CNrrrrrrsr)rZr�rr@r��rr�r�rrrrr�test___call___miss_wo_alternates
z.InterfaceTests.test___call___miss_wo_alternatecCsJddlm}Gdd�d|�}Gdd�dt�}|�}|�|||�|k�dS)Nrr�c@seZdZdS)z8InterfaceTests.test___call___miss_w_alternate.<locals>.INrrrrrr�"sr�c@seZdZdS)z8InterfaceTests.test___call___miss_w_alternate.<locals>.CNrrrrrr%sr)rZr�rrerrrr�test___call___miss_w_alternates
z-InterfaceTests.test___call___miss_w_alternatec

s�ddlm}ddlm}|dd�}dd�}�fdd�}Gdd	�d	|�}Gd
d�dt�}|�}|dd�}	||g|dd�<z��||��k�W5|	|dd�<XdS)Nrr�r�cSsdSrrr�rrr�_miss0sz:InterfaceTests.test___call___w_adapter_hook.<locals>._misscs�Srrr�rPrr�_hit3sz9InterfaceTests.test___call___w_adapter_hook.<locals>._hitc@seZdZdS)z6InterfaceTests.test___call___w_adapter_hook.<locals>.INrrrrrr�6sr�c@seZdZdS)z6InterfaceTests.test___call___w_adapter_hook.<locals>.CNrrrrrr9sr)rZr�rr�rre)
rr�r�Z	old_hooksrr	r�rrZold_adapter_hooksrrPr�test___call___w_adapter_hook+sz+InterfaceTests.test___call___w_adapter_hookN)0rrrrYr]rkrnrpryr|r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r�r�r�rrrrr
rrrrrU�sZ	
!+
9))
	/5
rUc@seZdZdZdd�ZdS)�AttributeTestsZ
TestAttributecCsddlm}|S)Nrr�)rr�)rr�rrrr0JszAttributeTests._getTargetClassN)rrrr1r0rrrrrFsrc@sXeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�ZdS)�MethodTestsZ
TestMethodcCsddlm}|S)Nrr�)rr�)rr�rrrr0SszMethodTests._getTargetClasscCsH|��}|�|ji�ddi|_|�|jddi�|`|�|ji�dSrH)r3rr��rr[rrr�test_optional_as_propertyWs
z%MethodTests.test_optional_as_propertyc
Csnddlm}|��}z
|�Wn@|k
r^}z"|�|jd�|�|j|j�W5d}~XYnX|�d�dS)Nr)�BrokenImplementationz*__call__ should raise BrokenImplementation)r�rr3rrRr2r1r�)rrr[r�rrr�)test___call___raises_BrokenImplementation_s
"z5MethodTests.test___call___raises_BrokenImplementationcCsl|��}|��}|�t|d�g�|�t|d�g�|�|di�|�|dd�|�|dd�dS)N�
positional�requiredr��varargs�kwargs)r3�getSignatureInforr8)rr[�inforrr�test_getSignatureInfo_barejsz&MethodTests.test_getSignatureInfo_barecCs|��}|�|��d�dS)Nz())r3r�getSignatureStringr
rrr�test_getSignatureString_baressz(MethodTests.test_getSignatureString_barecCs*|��}dg|_|_|�|��d�dS)NrIz(foo))r3rrrrr
rrr�'test_getSignatureString_w_only_requiredwsz3MethodTests.test_getSignatureString_w_only_requiredcCs4|��}dg|_|_ddi|_|�|��d�dS)NrIr&z(foo='bar'))r3rrr�rrr
rrr�"test_getSignatureString_w_optional|s
z.MethodTests.test_getSignatureString_w_optionalcCs"|��}d|_|�|��d�dS)Nrz(*args))r3rrrr
rrr�!test_getSignatureString_w_varargs�sz-MethodTests.test_getSignatureString_w_varargscCs"|��}d|_|�|��d�dS)Nr
z(**kw))r3rrrr
rrr� test_getSignatureString_w_kwargs�sz,MethodTests.test_getSignatureString_w_kwargsN)
rrrr1r0rrrrrrrrrrrrrOs	rc@s\eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)�Test_fromFunctioncOsddlm}|||�S)Nrr�)rr�)rrr
r�rrr�_callFUT�szTest_fromFunction._callFUTcCs�dd�}|�|�}|�|��d�|�|��d�|�|jd�|�t|���g�|��}|�t|d�g�|�t|d�g�|�|di�|�|dd�|�|d	d�dS)
NcSsdSr�rrrrr�_func�sz*Test_fromFunction.test_bare.<locals>._funcr r�rrr�rr�rrr5r7rRr8r9r�rr r[rrrr�	test_bare�s
zTest_fromFunction.test_barecCsDddlm}Gdd�d|�}dd�}|j||d�}|�|j|�dS)Nrr�c@seZdZdS)z0Test_fromFunction.test_w_interface.<locals>.IFooNrrrrrr��sr�cSsdSr�rrrrrr �sz1Test_fromFunction.test_w_interface.<locals>._funcrQ)rr�rrrR)rr�r�r r[rrr�test_w_interface�s
z"Test_fromFunction.test_w_interfacecCs*dd�}|j|dd�}|�|��d�dS)NcSsdSr�rrrrrr �sz,Test_fromFunction.test_w_name.<locals>._funcZanotherName)r2)rrr5)rr r[rrr�test_w_name�szTest_fromFunction.test_w_namecCszdd�}|�|�}|��}|�t|d�dg�|�t|d�dg�|�|di�|�|dd�|�|dd�dS)	NcSsdSr�r�rIrrrr �sz5Test_fromFunction.test_w_only_required.<locals>._funcrrIrr�rr�rrrr8r"rrr�test_w_only_required�s
z&Test_fromFunction.test_w_only_requiredcCs~d
dd�}|�|�}|��}|�t|d�dg�|�t|d�g�|�|dddi�|�|dd�|�|d	d�dS)Nr&cSsdSr�rr&rrrr �sz0Test_fromFunction.test_w_optional.<locals>._funcrrIrr�rr)r&r'r"rrr�test_w_optional�s

z!Test_fromFunction.test_w_optionalcCs|ddd�}|j|dd�}|��}|�t|d�g�|�t|d�g�|�|di�|�|d	d�|�|d
d�dS)Nr&cSsdSr�rrPrrrr �sz5Test_fromFunction.test_w_optional_self.<locals>._funcr�)Zimlevelrrr�rr)r&r'r"rrr�test_w_optional_self�s
z&Test_fromFunction.test_w_optional_selfcCsvdd�}|�|�}|��}|�t|d�g�|�t|d�g�|�|di�|�|dd�|�|dd�dS)	NcWsdSr�rr�rrrr �sz/Test_fromFunction.test_w_varargs.<locals>._funcrrr�rrrr'r"rrr�test_w_varargs�s
z Test_fromFunction.test_w_varargscCsvdd�}|�|�}|��}|�t|d�g�|�t|d�g�|�|di�|�|dd�|�|dd�dS)	Nc[sdSr�r)r
rrrr �sz.Test_fromFunction.test_w_kwargs.<locals>._funcrrr�rrr
r'r"rrr�
test_w_kwargs�s
zTest_fromFunction.test_w_kwargscCs�d
dd�}|�|�}|��}|�t|d�ddg�|�t|d�dg�|�|dddi�|�|d	d
�|�|dd�dS)Nr'c_sdSr�r)rIr&rr
rrrr �sz3Test_fromFunction.test_full_spectrum.<locals>._funcrrIr&rr�rrrr
)r'r'r"rrr�test_full_spectrum�s

z$Test_fromFunction.test_full_spectrumN)
rrrrr#r$r%r(r)r*r+r,r-rrrrr�s	rc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�Test_fromMethodcOsddlm}|||�S)Nr)�
fromMethod)rr/)rrr
r/rrrr�szTest_fromMethod._callFUTcCs�Gdd�dt�}|�|j�}|�|��d�|�|��d�|�|jd�|�t|���g�|�	�}|�t|d�g�|�t|d�g�|�|di�|�|dd�|�|d	d�dS)
Nc@seZdZdd�ZdS)z)Test_fromMethod.test_no_args.<locals>.FoocSsdSr�rrPrrrr&sz-Test_fromMethod.test_no_args.<locals>.Foo.barNr�rrrrrsrr&r�rrr�rr)
rrr&rr5r7rRr8r9r�rrr[rrrr�test_no_argsszTest_fromMethod.test_no_argscCs�Gdd�dt�}|�|j�}|��}|�t|d�ddg�|�t|d�dg�|�|dddi�|�|d	d
�|�|dd�dS)
Nc@seZdZddd�ZdS)z/Test_fromMethod.test_full_spectrum.<locals>.Foor'c_sdSr�r)rrIr&rr
rrrr&sz3Test_fromMethod.test_full_spectrum.<locals>.Foo.barN)r'r�rrrrrsrrrIr&rr�r'rrrr
)rrr&rrr8r0rrrr-sz"Test_fromMethod.test_full_spectrumcCs�dd�}|�|�}|�|��d�|�|��d�|�|jd�|�t|���g�|��}|�t|d�g�|�t|d�g�|�|di�|�|dd�|�|d	d�dS)
NcSsdSr�rrrrrrIsz.Test_fromMethod.test_w_non_method.<locals>.foorIr�rrr�rrr!)rrIr[rrrr�test_w_non_methods
z!Test_fromMethod.test_w_non_methodN)rrrrr1r-r2rrrrr.�sr.c@seZdZdd�Zdd�ZdS)r�cCs
g|_dSr)r�rPrrrrD.szDummyDependent.__init__cCs|j�|�dSr)r�r�)rZoriginally_changedrrrr�1szDummyDependent.changedN)rrrrDr�rrrrr�,sr�cCsNddlm}t|dd�}t|dd�}|dk	rJt|t|��rJ||ksJ|d��dS)Nrr.rIr&r�)r�r/rr9�type)rVr/rIr&rrrr�5sr�cCs0ddlm}t|dd�r,t|dd�s,|d��dS)Nrr.rIr&r�)r�r/r)rVr/rrrr�Asr�c@s$eZdZdd�Zdd�Zdd�ZdS)r\cs@�|_t�fdd�|D��|_|��D]\}}t�||�q&dS)Ncsg|]}|t�|�f�qSr)r)r��key��modulerrr�Ksz$_Monkey.__init__.<locals>.<listcomp>)r6�dict�
to_restore�items�setattr)rr6r
r4r�rr5rrDIsz_Monkey.__init__cCs|SrrrPrrr�	__enter__Osz_Monkey.__enter__cCs&|j��D]\}}t|j||�q
dSr)r8r9r:r6)r�exc_typeZexc_val�exc_tbr4r�rrr�__exit__Rsz_Monkey.__exit__N)rrrrDr;r>rrrrr\Gsr\)r6ZunittestZzope.interface._compatrrr�ZTestCaserr#r.rLrur~r�r�r�rUrrrr.r�r�r�r\rrrr�<module>s>!$.F=seJ	>n1