3
,ςΏW/ γ @ sp d Z ddlZG dd dejZG dd dejZG dd dejZG d d
d
ejZG dd deZd
d Z dS )zTests for z.c.registry
ι Nc @ s, e Zd ZddlmZmZ dd Zdd ZdS )Ϊ%Test_dispatchUtilityRegistrationEventr )ΪsetUpΪtearDownc O s ddl m} |||S )Nr )Ϊ dispatchUtilityRegistrationEvent)Ϊzope.component.registryr )ΪselfΪargsΪkwr © r
ϊ#/usr/lib/python3.6/test_registry.pyΪ_callFUT s z.Test_dispatchUtilityRegistrationEvent._callFUTc sp ddl m} G dd dt}t }g fdd}t||d | j| | W d Q R X | j |j|fg d S )Nr )Ϊregistryc @ s e Zd Ze ZdS )zDTest_dispatchUtilityRegistrationEvent.test_it.._RegistrationN)Ϊ__name__Ϊ
__module__Ϊ__qualname__ΪobjectΪ componentr
r
r
r Ϊ
_Registration s r c s j | d S )N)Ϊappend)r )Ϊ_handledr
r Ϊ_handle! s z>Test_dispatchUtilityRegistrationEvent.test_it.._handle)Ϊhandle)Ϊzope.componentr
r Ϊ_Monkeyr ΪassertEqualr )r r
r Ϊ_EVENTr r
)r r Ϊtest_it s z-Test_dispatchUtilityRegistrationEvent.test_itN)r r r Ϊzope.component.testingr r r r r
r
r
r r s r c @ s, e Zd ZddlmZmZ dd Zdd ZdS )Ϊ%Test_dispatchAdapterRegistrationEventr )r r c O s ddl m} |||S )Nr )Ϊ dispatchAdapterRegistrationEvent)r r )r r r r r
r
r r , s z.Test_dispatchAdapterRegistrationEvent._callFUTc st ddl m} G dd dt}| }t }g fdd}t||d | j|| W d Q R X | j |j|fg d S )Nr )r
c @ s e Zd Zdd ZdS )zDTest_dispatchAdapterRegistrationEvent.test_it.._Registrationc _ s d S )Nr
)r r r r
r
r Ϊfactory3 s zLTest_dispatchAdapterRegistrationEvent.test_it.._Registration.factoryN)r r r r r
r
r
r r 2 s r c s j | d S )N)r )r )r r
r r 8 s z>Test_dispatchAdapterRegistrationEvent.test_it.._handle)r )r r
r r r r r )r r
r Ϊ
_registrationr r r
)r r r 0 s z-Test_dispatchAdapterRegistrationEvent.test_itN)r r r r r r r r r
r
r
r r ( s r c @ s, e Zd ZddlmZmZ dd Zdd ZdS )Ϊ1Test_dispatchSubscriptionAdapterRegistrationEventr )r r c O s ddl m} |||S )Nr )Ϊ,dispatchSubscriptionAdapterRegistrationEvent)r r# )r r r r# r
r
r r C s z:Test_dispatchSubscriptionAdapterRegistrationEvent._callFUTc st ddl m} G dd dt}| }t }g fdd}t||d | j|| W d Q R X | j |j|fg d S )Nr )r
c @ s e Zd Zdd ZdS )zPTest_dispatchSubscriptionAdapterRegistrationEvent.test_it.._Registrationc _ s d S )Nr
)r r r r
r
r r K s zXTest_dispatchSubscriptionAdapterRegistrationEvent.test_it.._Registration.factoryN)r r r r r
r
r
r r J s r c s j | d S )N)r )r )r r
r r P s zJTest_dispatchSubscriptionAdapterRegistrationEvent.test_it.._handle)r )r r
r r r r r )r r
r r! r r r
)r r r H s z9Test_dispatchSubscriptionAdapterRegistrationEvent.test_itN)r r r r r r r r r
r
r
r r" ? s r" c @ s, e Zd ZddlmZmZ dd Zdd ZdS )Ϊ%Test_dispatchHandlerRegistrationEventr )r r c O s ddl m} |||S )Nr )Ϊ dispatchHandlerRegistrationEvent)r r% )r r r r% r
r
r r [ s z.Test_dispatchHandlerRegistrationEvent._callFUTc st ddl m} G dd dt}| }t }g fdd}t||d | j|| W d Q R X | j |j|fg d S )Nr )r
c @ s e Zd Zdd ZdS )zDTest_dispatchHandlerRegistrationEvent.test_it.._Registrationc _ s d S )Nr
)r r r r
r
r Ϊhandlerb s zLTest_dispatchHandlerRegistrationEvent.test_it.._Registration.handlerN)r r r r&