ó
6j/Qc           @   s™   d  Z  d d l Z d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d	 e j f d
 „  ƒ  YZ d e f d „  ƒ  YZ d „  Z	 d S(   s   Tests for z.c.registry
iÿÿÿÿNt%   Test_dispatchUtilityRegistrationEventc           B   s0   e  Z d  d l m Z m Z d „  Z d „  Z RS(   iÿÿÿÿ(   t   setUpt   tearDownc         O   s   d d l  m } | | | Ž  S(   Niÿÿÿÿ(   t    dispatchUtilityRegistrationEvent(   t   zope.component.registryR   (   t   selft   argst   kwR   (    (    sF   /usr/lib/python2.7/site-packages/zope/component/tests/test_registry.pyt   _callFUT   s    c            s   d d l  m } d t f d „  ƒ  Y} t ƒ  } g  ‰  ‡  f d †  } t | d | ƒ |  j | ƒ  | ƒ Wd  QX|  j ˆ  | j | f g ƒ d  S(   Niÿÿÿÿ(   t   registryt   _Registrationc           B   s   e  Z e ƒ  Z RS(    (   t   __name__t
   __module__t   objectt	   component(    (    (    sF   /usr/lib/python2.7/site-packages/zope/component/tests/test_registry.pyR
      s   c             s   ˆ  j  |  ƒ d  S(   N(   t   append(   R   (   t   _handled(    sF   /usr/lib/python2.7/site-packages/zope/component/tests/test_registry.pyt   _handle!   s    t   handle(   t   zope.componentR	   R   t   _MonkeyR   t   assertEqualR   (   R   R	   R
   t   _EVENTR   (    (   R   sF   /usr/lib/python2.7/site-packages/zope/component/tests/test_registry.pyt   test_it   s    	(   R   R   t   zope.component.testingR   R   R   R   (    (    (    sF   /usr/lib/python2.7/site-packages/zope/component/tests/test_registry.pyR       s   	t%   Test_dispatchAdapterRegistrationEventc           B   s0   e  Z d  d l m Z m Z d „  Z d „  Z RS(   iÿÿÿÿ(   R   R   c         O   s   d d l  m } | | | Ž  S(   Niÿÿÿÿ(   t    dispatchAdapterRegistrationEvent(   R   R   (   R   R   R   R   (    (    sF   /usr/lib/python2.7/site-packages/zope/component/tests/test_registry.pyR   ,   s    c            s–   d d l  m } d t f d „  ƒ  Y} | ƒ  } t ƒ  } g  ‰  ‡  f d †  } t | d | ƒ |  j | | ƒ Wd  QX|  j ˆ  | j | f g ƒ d  S(   Niÿÿÿÿ(   R	   R
   c           B   s   e  Z d  „  Z RS(   c         _   s   d  S(   N(    (   R   R   R   (    (    sF   /usr/lib/python2.7/site-packages/zope/component/tests/test_registry.pyt   factory3   s    (   R   R   R   (    (    (    sF   /usr/lib/python2.7/site-packages/zope/component/tests/test_registry.pyR
   2   s   c             s   ˆ  j  |  ƒ d  S(   N(   R   (   R   (   R   (    sF   /usr/lib/python2.7/site-packages/zope/component/tests/test_registry.pyR   8   s    R   (   R   R	   R   R   R   R   R   (   R   R	   R
   t   _registrationR   R   (    (   R   sF   /usr/lib/python2.7/site-packages/zope/component/tests/test_registry.pyR   0   s    		(   R   R   R   R   R   R   R   (    (    (    sF   /usr/lib/python2.7/site-packages/zope/component/tests/test_registry.pyR   (   s   	t1   Test_dispatchSubscriptionAdapterRegistrationEventc           B   s0   e  Z d  d l m Z m Z d „  Z d „  Z RS(   iÿÿÿÿ(   R   R   c         O   s   d d l  m } | | | Ž  S(   Niÿÿÿÿ(   t,   dispatchSubscriptionAdapterRegistrationEvent(   R   R   (   R   R   R   R   (    (    sF   /usr/lib/python2.7/site-packages/zope/component/tests/test_registry.pyR   C   s    c            s–   d d l  m } d t f d „  ƒ  Y} | ƒ  } t ƒ  } g  ‰  ‡  f d †  } t | d | ƒ |  j | | ƒ Wd  QX|  j ˆ  | j | f g ƒ d  S(   Niÿÿÿÿ(   R	   R
   c           B   s   e  Z d  „  Z RS(   c         _   s   d  S(   N(    (   R   R   R   (    (    sF   /usr/lib/python2.7/site-packages/zope/component/tests/test_registry.pyR   K   s    (   R   R   R   (    (    (    sF   /usr/lib/python2.7/site-packages/zope/component/tests/test_registry.pyR
   J   s   c             s   ˆ  j  |  ƒ d  S(   N(   R   (   R   (   R   (    sF   /usr/lib/python2.7/site-packages/zope/component/tests/test_registry.pyR   P   s    R   (   R   R	   R   R   R   R   R   (   R   R	   R
   R   R   R   (    (   R   sF   /usr/lib/python2.7/site-packages/zope/component/tests/test_registry.pyR   H   s    		(   R   R   R   R   R   R   R   (    (    (    sF   /usr/lib/python2.7/site-packages/zope/component/tests/test_registry.pyR   ?   s   	t%   Test_dispatchHandlerRegistrationEventc           B   s0   e  Z d  d l m Z m Z d „  Z d „  Z RS(   iÿÿÿÿ(   R   R   c         O   s   d d l  m } | | | Ž  S(   Niÿÿÿÿ(   t    dispatchHandlerRegistrationEvent(   R   R    (   R   R   R   R    (    (    sF   /usr/lib/python2.7/site-packages/zope/component/tests/test_registry.pyR   [   s    c            s–   d d l  m } d t f d „  ƒ  Y} | ƒ  } t ƒ  } g  ‰  ‡  f d †  } t | d | ƒ |  j | | ƒ Wd  QX|  j ˆ  | j | f g ƒ d  S(   Niÿÿÿÿ(   R	   R
   c           B   s   e  Z d  „  Z RS(   c         _   s   d  S(   N(    (   R   R   R   (    (    sF   /usr/lib/python2.7/site-packages/zope/component/tests/test_registry.pyt   handlerb   s    (   R   R   R!   (    (    (    sF   /usr/lib/python2.7/site-packages/zope/component/tests/test_registry.pyR
   a   s   c             s   ˆ  j  |  ƒ d  S(   N(   R   (   R   (   R   (    sF   /usr/lib/python2.7/site-packages/zope/component/tests/test_registry.pyR   g   s    R   (   R   R	   R   R   R   R   R!   (   R   R	   R
   R   R   R   (    (   R   sF   /usr/lib/python2.7/site-packages/zope/component/tests/test_registry.pyR   _   s    		(   R   R   R   R   R   R   R   (    (    (    sF   /usr/lib/python2.7/site-packages/zope/component/tests/test_registry.pyR   W   s   	R   c           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         K   sk   | |  _  t g  | D] } | t | | ƒ f ^ q ƒ |  _ x* | j ƒ  D] \ } } t | | | ƒ qG Wd  S(   N(   t   modulet   dictt   getattrt
   to_restoret   itemst   setattr(   R   R"   R   t   keyt   value(    (    sF   /usr/lib/python2.7/site-packages/zope/component/tests/test_registry.pyt   __init__p   s    	1c         C   s   |  S(   N(    (   R   (    (    sF   /usr/lib/python2.7/site-packages/zope/component/tests/test_registry.pyt	   __enter__v   s    c         C   s7   x0 |  j  j ƒ  D] \ } } t |  j | | ƒ q Wd  S(   N(   R%   R&   R'   R"   (   R   t   exc_typet   exc_valt   exc_tbR(   R)   (    (    sF   /usr/lib/python2.7/site-packages/zope/component/tests/test_registry.pyt   __exit__y   s    (   R   R   R*   R+   R/   (    (    (    sF   /usr/lib/python2.7/site-packages/zope/component/tests/test_registry.pyR   n   s   		c           C   s=   t  j t  j t ƒ t  j t ƒ t  j t ƒ t  j t ƒ f ƒ S(   N(   t   unittestt	   TestSuitet	   makeSuiteR    R   R   R   (    (    (    sF   /usr/lib/python2.7/site-packages/zope/component/tests/test_registry.pyt
   test_suite}   s
    (
   t   __doc__R0   t   TestCaseR    R   R   R   R   R   R3   (    (    (    sF   /usr/lib/python2.7/site-packages/zope/component/tests/test_registry.pyt   <module>   s   