????

Your IP : 3.137.211.1


Current Path : /usr/lib/python3.6/site-packages/zope/component/tests/__pycache__/
Upload File :
Current File : //usr/lib/python3.6/site-packages/zope/component/tests/__pycache__/test_factory.cpython-36.pyc

3

,�W��@s2dZddlZGdd�dej�Zdd�Zdd�ZdS)	zTests for z.c.factory
�Nc@sfeZdZdd�Zddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�FactoryTestscCsddlm}|S)Nr)�Factory)Zzope.component.factoryr)�selfr�r�"/usr/lib/python3.6/test_factory.py�_getTargetClassszFactoryTests._getTargetClassNcOs |dkrt}|j�|f|�|�S)N)�_test_callabler)r�callable�args�kwrrr�_makeOneszFactoryTests._makeOnecCs*ddlm}ddlm}|||j��dS)Nr)�verifyClass)�IFactory)�zope.interface.verifyr
�zope.component.interfacesrr)rr
rrrr�test_class_conforms_to_IFactorysz,FactoryTests.test_class_conforms_to_IFactorycCs*ddlm}ddlm}|||j��dS)Nr)�verifyObject)r)rrrrr)rrrrrr�"test_instance_conforms_to_IFactory#sz/FactoryTests.test_instance_conforms_to_IFactorycCsD|j�}|j|jt�|j|jd�|j|jd�|j|jd�dS)N�)r�assertEqual�	_callabler�title�descriptionZ_interfaces)r�factoryrrr�test_ctor_defaults(s
zFactoryTests.test_ctor_defaultscCs.|jtdd�}|j|jd�|j|jd�dS)NZTITLEZDESCRIPTION)rrrrr)rrrrr�test_ctor_expclit/szFactoryTests.test_ctor_expclitcs6g��fdd�}|j|�}|�|j�fifg�dS)Ncs�j||f�dS)N)�append)r
r)�_calledrrr6sz5FactoryTests.test___call___no_args.<locals>._callable)rr)rrrr)rr�test___call___no_args4s

z"FactoryTests.test___call___no_argscs:g��fdd�}|j|�}|dd�|j�difg�dS)Ncs�j||f�dS)N)r)r
r)rrrr>sz=FactoryTests.test___call___positional_args.<locals>._callable�one�two)rr )rr)rrrr)rr�test___call___positional_args<s


z*FactoryTests.test___call___positional_argscs>g��fdd�}|j|�}|dd�|j�fddifg�dS)Ncs�j||f�dS)N)r)r
r)rrrrFsz:FactoryTests.test___call___keyword_args.<locals>._callableZbar)�foor")rr)rrrr)rr�test___call___keyword_argsDs


z'FactoryTests.test___call___keyword_argsc	Cs�ddlm}ddlm}Gdd�d|�}Gdd�d|�}Gdd	�d	|�}||�d
d��}|j|||fd�}|j�}|j|jd
�|jt|�||g�dS)Nr)�	Interface)�implementerc@seZdZdS)z6FactoryTests.test_getInterfaces_explicit.<locals>.IFooN)�__name__�
__module__�__qualname__rrrr�IFooOsr)c@seZdZdS)z6FactoryTests.test_getInterfaces_explicit.<locals>.IBarN)r&r'r(rrrr�IBarQsr*c@seZdZdS)z6FactoryTests.test_getInterfaces_explicit.<locals>.IBazN)r&r'r(rrrr�IBazSsr+cSsdS)NrrrrrrUsz;FactoryTests.test_getInterfaces_explicit.<locals>._callable)Z
interfacesr)�zope.interfacer$r%r�
getInterfacesrr&�list)	rr$r%r)r*r+rr�specrrr�test_getInterfaces_explicitLsz(FactoryTests.test_getInterfaces_explicitcCs`ddlm}ddlm}Gdd�d|�}||�dd��}|j|�}|j�}|jt|�|g�dS)Nr)r$)r%c@seZdZdS)z6FactoryTests.test_getInterfaces_implicit.<locals>.IBazN)r&r'r(rrrrr+`sr+cSsdS)Nrrrrrrbsz;FactoryTests.test_getInterfaces_implicit.<locals>._callable)r,r$r%rr-rr.)rr$r%r+rrr/rrr�test_getInterfaces_implicit]s
z(FactoryTests.test_getInterfaces_implicit)N)r&r'r(rrrrrrrr!r#r0r1rrrrrs
rcOsdS)Nr)r
rrrrrisrcCstjtjt�f�S)N)�unittestZ	TestSuiteZ	makeSuiterrrrr�
test_suitelsr3)�__doc__r2ZTestCaserrr3rrrr�<module>sV