ó
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 j f d „  ƒ  YZ d „  Z d S(   s    Tests for z.c._api
iÿÿÿÿNt   Test_getGlobalSiteManagerc           B   s,   e  Z d  „  Z d „  Z d „  Z d „  Z RS(   c         C   s   d d l  m } | ƒ  S(   Niÿÿÿÿ(   t   getGlobalSiteManager(   t   zope.component.globalregistryR   (   t   selfR   (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyt   _callFUT   s    c         C   sY   d d l  m } d d l m } |  j ƒ  } |  j | | k ƒ |  j | j | ƒ ƒ d  S(   Niÿÿÿÿ(   t   base(   t   IComponentLookup(   R   R   t   zope.component.interfacesR   R   t
   assertTruet
   providedBy(   R   R   R   t   gsm(    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyt   test_gsm_is_IComponentLookup   s
    c         C   s)   |  j  ƒ  } |  j |  j  ƒ  | k ƒ d  S(   N(   R   R   (   R   R
   (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyt   test_gsm_is_singleton   s    c   	      C   s¿   d d l  m } |  j ƒ  } | j | ƒ } | j | ƒ } |  j | | k ƒ | j | j ƒ } | j | ƒ } |  j | | j k ƒ | j | j ƒ } | j | ƒ } |  j | | j k ƒ d  S(   Niÿÿÿÿ(   t   _pickle(   t   zope.component._compatR   R   t   dumpst   loadsR   t	   utilitiest   adapters(	   R   R   R
   t   dumpedt   loadedt   dumped_utilitiest   loaded_utilitiest   dumped_adapterst   loaded_adapters(    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyt   test_gsm_pickling#   s    (   t   __name__t
   __module__R   R   R   R   (    (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR       s   			t   Test_provideUtilityc           B   s9   e  Z d  d l m Z m Z d „  Z d „  Z d „  Z RS(   iÿÿÿÿ(   t   setUpt   tearDownc         O   s   d d l  m } | | | Ž  S(   Niÿÿÿÿ(   t   provideUtility(   R   R   (   R   t   argst   kwR   (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR   7   s    c         C   sª   d d l  m } d d l  m } d d l m } d | f d „  ƒ  Y} | | ƒ d t f d „  ƒ  Yƒ } | ƒ  } |  j | ƒ | ƒ  } |  j | j | d	 ƒ | k ƒ d  S(
   Niÿÿÿÿ(   t	   Interface(   t   implementer(   R   t   IFooc           B   s   e  Z RS(    (   R   R   (    (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR$   ?   s   t   Fooc           B   s   e  Z RS(    (   R   R   (    (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR%   A   s   t    (	   t   zope.interfaceR"   R#   R   R   t   objectR   R   t
   getUtility(   R   R"   R#   R   R$   R%   t   fooR
   (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyt   test_anonymous_no_provides;   s    		c         C   s”   d d l  m } d d l m } d | f d „  ƒ  Y} d t f d „  ƒ  Y} | ƒ  } |  j | | d ƒ | ƒ  } |  j | j | d ƒ | k ƒ d  S(	   Niÿÿÿÿ(   R"   (   R   R$   c           B   s   e  Z RS(    (   R   R   (    (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR$   L   s   R%   c           B   s   e  Z RS(    (   R   R   (    (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR%   N   s   t   named(   R'   R"   R   R   R(   R   R   R)   (   R   R"   R   R$   R%   R*   R
   (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyt   test_named_w_providesI   s    		(   R   R   t   zope.component.testingR   R   R   R+   R-   (    (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR   3   s   		t   Test_provideAdapterc           B   s9   e  Z d  d l m Z m Z d „  Z d „  Z d „  Z RS(   iÿÿÿÿ(   R   R   c         O   s   d d l  m } | | | Ž  S(   Niÿÿÿÿ(   t   provideAdapter(   R   R0   (   R   R    R!   R0   (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR   Z   s    c         C   s  d d l  m } d d l  m } d d l m } d d l m } d | f d „  ƒ  Y} d | f d	 „  ƒ  Y} | | ƒ d
 t f d „  ƒ  Yƒ } | | ƒ | | ƒ d t f d „  ƒ  Yƒ ƒ } |  j | ƒ | ƒ  }	 | ƒ  }
 |	 j	 |
 | ƒ } |  j
 t | | ƒ ƒ |  j
 | j |
 k ƒ d  S(   Niÿÿÿÿ(   R"   (   R#   (   R   (   t   adapterR$   c           B   s   e  Z RS(    (   R   R   (    (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR$   c   s   t   IBarc           B   s   e  Z RS(    (   R   R   (    (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR2   e   s   R%   c           B   s   e  Z RS(    (   R   R   (    (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR%   g   s   t   Barc           B   s   e  Z d  „  Z RS(   c         S   s   | |  _  d  S(   N(   t   context(   R   R4   (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyt   __init__m   s    (   R   R   R5   (    (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR3   j   s   (   R'   R"   R#   R   R   t   zope.component._apiR1   R(   R   t
   getAdapterR   t
   isinstanceR4   (   R   R"   R#   R   R1   R$   R2   R%   R3   R
   R*   t   adapted(    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyt$   test_anonymous_no_provides_no_adapts^   s"    			c         C   s  d d l  m } d d l  m } d d l m } d | f d „  ƒ  Y} d | f d „  ƒ  Y} | | ƒ d	 t f d
 „  ƒ  Yƒ } d t f d „  ƒ  Y} |  j | | f | d ƒ | ƒ  } | ƒ  }	 | j |	 | d d ƒ}
 |  j t	 |
 | ƒ ƒ |  j |
 j
 |	 k ƒ d  S(   Niÿÿÿÿ(   R"   (   R#   (   R   R$   c           B   s   e  Z RS(    (   R   R   (    (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR$   z   s   R2   c           B   s   e  Z RS(    (   R   R   (    (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR2   |   s   R%   c           B   s   e  Z RS(    (   R   R   (    (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR%   ~   s   R3   c           B   s   e  Z d  „  Z RS(   c         S   s   | |  _  d  S(   N(   R4   (   R   R4   (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR5   ‚   s    (   R   R   R5   (    (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR3      s   t   testt   name(   R'   R"   R#   R   R   R(   R   R7   R   R8   R4   (   R   R"   R#   R   R$   R2   R%   R3   R
   R*   R9   (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyt   test_named_w_provides_w_adaptsv   s    		(   R   R   R.   R   R   R   R:   R=   (    (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR/   V   s   		t   Test_provideSubscriptionAdapterc           B   s9   e  Z d  d l m Z m Z d „  Z d „  Z d „  Z RS(   iÿÿÿÿ(   R   R   c         O   s   d d l  m } | | | Ž  S(   Niÿÿÿÿ(   t   provideSubscriptionAdapter(   R   R?   (   R   R    R!   R?   (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR      s    c         C   s>  d d l  m } d d l  m } d d l m } d d l m } d | f d „  ƒ  Y} d | f d	 „  ƒ  Y} | | ƒ d
 t f d „  ƒ  Yƒ } | | ƒ | | ƒ d t f d „  ƒ  Yƒ ƒ } |  j | ƒ | ƒ  }	 | ƒ  }
 |	 j	 |
 f | ƒ } |  j
 t | ƒ d ƒ |  j t | d | ƒ ƒ |  j | d j |
 k ƒ d  S(   Niÿÿÿÿ(   R"   (   R#   (   R   (   R1   R$   c           B   s   e  Z RS(    (   R   R   (    (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR$   ™   s   R2   c           B   s   e  Z RS(    (   R   R   (    (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR2   ›   s   R%   c           B   s   e  Z RS(    (   R   R   (    (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR%      s   R3   c           B   s   e  Z d  „  Z RS(   c         S   s   | |  _  d  S(   N(   R4   (   R   R4   (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR5   £   s    (   R   R   R5   (    (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR3       s   i   i    (   R'   R"   R#   R   R   R6   R1   R(   R   t   subscriberst   assertEqualt   lenR   R8   R4   (   R   R"   R#   R   R1   R$   R2   R%   R3   R
   R*   R9   (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyt   test_no_provides_no_adapts”   s$    			c         C   s  d d l  m } d d l  m } d d l m } d | f d „  ƒ  Y} d | f d „  ƒ  Y} | | ƒ d	 t f d
 „  ƒ  Yƒ } d t f d „  ƒ  Y} |  j | | f | ƒ | ƒ  } | ƒ  }	 | j |	 f | ƒ }
 |  j t	 |
 ƒ d ƒ |  j
 t |
 d | ƒ ƒ |  j
 |
 d j |	 k ƒ d  S(   Niÿÿÿÿ(   R"   (   R#   (   R   R$   c           B   s   e  Z RS(    (   R   R   (    (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR$   ±   s   R2   c           B   s   e  Z RS(    (   R   R   (    (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR2   ³   s   R%   c           B   s   e  Z RS(    (   R   R   (    (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR%   µ   s   R3   c           B   s   e  Z d  „  Z RS(   c         S   s   | |  _  d  S(   N(   R4   (   R   R4   (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR5   ¹   s    (   R   R   R5   (    (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR3   ¸   s   i   i    (   R'   R"   R#   R   R   R(   R   R@   RA   RB   R   R8   R4   (   R   R"   R#   R   R$   R2   R%   R3   R
   R*   R9   (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyt   test_w_provides_w_adapts­   s    		(   R   R   R.   R   R   R   RC   RD   (    (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR>   Œ   s   		t   Test_provideHandlerc           B   s9   e  Z d  d l m Z m Z d „  Z d „  Z d „  Z RS(   iÿÿÿÿ(   R   R   c         O   s   d d l  m } | | | Ž  S(   Niÿÿÿÿ(   t   provideHandler(   R   RF   (   R   R    R!   RF   (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR   È   s    c         C   s:  d d l  m } d d l  m } d d l  m } d d l m } d d l m } d | f d „  ƒ  Y} | | ƒ d	 t f d
 „  ƒ  Yƒ } | | ƒ d „  ƒ } |  j	 | ƒ | ƒ  }	 t
 |	 j ƒ  ƒ }
 |  j t |
 ƒ d ƒ |
 d } |  j t
 | j ƒ t
 | | ƒ  ƒ ƒ ƒ |  j | j d ƒ |  j | j | k ƒ d  S(   Niÿÿÿÿ(   R"   (   R#   (   R	   (   R   (   R1   R$   c           B   s   e  Z RS(    (   R   R   (    (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR$   Ò   s   R%   c           B   s   e  Z RS(    (   R   R   (    (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR%   Ô   s   c         S   s   d s t  d ƒ ‚ d  S(   Ni    s   DON'T GO HERE(   t   AssertionError(   R4   (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyt   _handler×   s    i   i    R&   (   R'   R"   R#   R	   R   R   R6   R1   R(   R   t   listt   registeredHandlersRA   RB   t   requiredR<   R   t   factory(   R   R"   R#   R	   R   R1   R$   R%   RH   R
   t   regst   hr(    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyt   test_no_adaptsÌ   s"    	
(c         C   sÖ   d d l  m } d d l m } d | f d „  ƒ  Y} d „  } |  j | | f ƒ | ƒ  } t | j ƒ  ƒ } |  j t | ƒ d ƒ | d } |  j t | j	 ƒ | g ƒ |  j | j
 d	 ƒ |  j | j | k ƒ d  S(
   Niÿÿÿÿ(   R"   (   R   R$   c           B   s   e  Z RS(    (   R   R   (    (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyR$   æ   s   c         S   s   d s t  d ƒ ‚ d  S(   Ni    s   DON'T GO HERE(   RG   (   R4   (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyRH   è   s    i   i    R&   (   R'   R"   R   R   R   RI   RJ   RA   RB   RK   R<   R   RL   (   R   R"   R   R$   RH   R
   RM   RN   (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyt   test_w_adaptsã   s    		
(   R   R   R.   R   R   R   RO   RP   (    (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyRE   Ä   s   		c           C   sI   t  j t  j t ƒ t  j t ƒ t  j t ƒ t  j t ƒ t  j t ƒ f ƒ S(   N(   t   unittestt	   TestSuitet	   makeSuiteR    R   R/   R>   RE   (    (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyt
   test_suiteô   s    (	   t   __doc__RQ   t   TestCaseR    R   R/   R>   RE   RT   (    (    (    sL   /usr/lib/python2.7/site-packages/zope/component/tests/test_globalregistry.pyt   <module>   s   !#680