Your IP : 216.73.216.172


Current Path : /lib/python3/dist-packages/zope/component/tests/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/zope/component/tests/__pycache__/test_factory.cpython-38.pyc

U

,�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�C/usr/lib/python3/dist-packages/zope/component/tests/test_factory.py�_getTargetClassszFactoryTests._getTargetClassNcOs |dkrt}|��|f|�|�S�N)�_test_callabler)r�callable�args�kwrrr�_makeOneszFactoryTests._makeOnecCs*ddlm}ddlm}|||���dS)Nr)�verifyClass��IFactory)�zope.interface.verifyr�zope.component.interfacesrr)rrrrrr�test_class_conforms_to_IFactorysz,FactoryTests.test_class_conforms_to_IFactorycCs*ddlm}ddlm}|||���dS)Nr)�verifyObjectr)rrrrr
)rrrrrr�"test_instance_conforms_to_IFactory#sz/FactoryTests.test_instance_conforms_to_IFactorycCsD|��}|�|jt�|�|jd�|�|jd�|�|jd�dS)N�)r
�assertEqual�	_callabler	�title�descriptionZ_interfaces�r�factoryrrr�test_ctor_defaults(s
zFactoryTests.test_ctor_defaultscCs.|�tdd�}|�|jd�|�|jd�dS)NZTITLEZDESCRIPTION)r
r	rrrrrrr�test_ctor_expclit/szFactoryTests.test_ctor_expclitcs6g��fdd�}|�|�}|�|��difg�dS)Ncs��||f�dSr��append�rr�Z_calledrrr6sz5FactoryTests.test___call___no_args.<locals>._callabler�r
r�rrrrr"r�test___call___no_args4s

z"FactoryTests.test___call___no_argscs:g��fdd�}|�|�}|dd�|��difg�dS)Ncs��||f�dSrrr!r"rrr>sz=FactoryTests.test___call___positional_args.<locals>._callable�one�two)r&r'r#r$rr"r�test___call___positional_args<s


z*FactoryTests.test___call___positional_argscs>g��fdd�}|�|�}|dd�|��dddifg�dS)Ncs��||f�dSrrr!r"rrrFsz:FactoryTests.test___call___keyword_args.<locals>._callableZbar)�foorr)r#r$rr"r�test___call___keyword_argsDs


z'FactoryTests.test___call___keyword_argsc	Cs�ddlm}ddlm}Gdd�d|�}Gdd�d|�}Gdd	�d	|�}||�d
d��}|j|||fd�}|��}|�|jd
�|�t|�||g�dS)Nr��	Interface��implementerc@seZdZdS)z6FactoryTests.test_getInterfaces_explicit.<locals>.IFooN��__name__�
__module__�__qualname__rrrr�IFooOsr3c@seZdZdS)z6FactoryTests.test_getInterfaces_explicit.<locals>.IBarNr/rrrr�IBarQsr4c@seZdZdS)z6FactoryTests.test_getInterfaces_explicit.<locals>.IBazNr/rrrr�IBazSsr5cSsdSrrrrrrrUsz;FactoryTests.test_getInterfaces_explicit.<locals>._callable)Z
interfacesr)�zope.interfacer,r.r
�
getInterfacesrr0�list)	rr,r.r3r4r5rr�specrrr�test_getInterfaces_explicitLs
z(FactoryTests.test_getInterfaces_explicitcCs`ddlm}ddlm}Gdd�d|�}||�dd��}|�|�}|��}|�t|�|g�dS)Nrr+r-c@seZdZdS)z6FactoryTests.test_getInterfaces_implicit.<locals>.IBazNr/rrrrr5`sr5cSsdSrrrrrrrbsz;FactoryTests.test_getInterfaces_implicit.<locals>._callable)r6r,r.r
r7rr8)rr,r.r5rrr9rrr�test_getInterfaces_implicit]s

z(FactoryTests.test_getInterfaces_implicit)N)r0r1r2rr
rrrrr%r(r*r:r;rrrrrs
rcOsdSrrr!rrrr	isr	cCst�t�t�f�Sr)�unittestZ	TestSuiteZ	makeSuiterrrrr�
test_suitels�r=)�__doc__r<ZTestCaserr	r=rrrr�<module>sV