ó
Z´¢Tc           @   sA   d  Z  d d l Z d e j f d „  ƒ  YZ d „  Z d „  Z d S(   s   Tests for z.c.factory
iÿÿÿÿNt   FactoryTestsc           B   sn   e  Z d  „  Z d d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z d	 „  Z d
 „  Z RS(   c         C   s   d d l  m } | S(   Niÿÿÿÿ(   t   Factory(   t   zope.component.factoryR   (   t   selfR   (    (    sE   /usr/lib/python2.7/dist-packages/zope/component/tests/test_factory.pyt   _getTargetClass   s    c         O   s+   | d  k r t } n  |  j ƒ  | | | Ž S(   N(   t   Nonet   _test_callableR   (   R   t   callablet   argst   kw(    (    sE   /usr/lib/python2.7/dist-packages/zope/component/tests/test_factory.pyt   _makeOne   s    	c         C   s7   d d l  m } d d l m } | | |  j ƒ  ƒ d  S(   Niÿÿÿÿ(   t   verifyClass(   t   IFactory(   t   zope.interface.verifyR   t   zope.component.interfacesR   R   (   R   R   R   (    (    sE   /usr/lib/python2.7/dist-packages/zope/component/tests/test_factory.pyt   test_class_conforms_to_IFactory   s    c         C   s7   d d l  m } d d l m } | | |  j ƒ  ƒ d  S(   Niÿÿÿÿ(   t   verifyObject(   R   (   R   R   R   R   R
   (   R   R   R   (    (    sE   /usr/lib/python2.7/dist-packages/zope/component/tests/test_factory.pyt"   test_instance_conforms_to_IFactory#   s    c         C   s\   |  j  ƒ  } |  j | j t ƒ |  j | j d ƒ |  j | j d ƒ |  j | j d  ƒ d  S(   Nt    (   R
   t   assertEqualt	   _callableR   t   titlet   descriptiont   _interfacesR   (   R   t   factory(    (    sE   /usr/lib/python2.7/dist-packages/zope/component/tests/test_factory.pyt   test_ctor_defaults(   s
    c         C   s?   |  j  t d d ƒ } |  j | j d ƒ |  j | j d ƒ d  S(   Nt   TITLEt   DESCRIPTION(   R
   R   R   R   R   (   R   R   (    (    sE   /usr/lib/python2.7/dist-packages/zope/component/tests/test_factory.pyt   test_ctor_expclit/   s    c            sH   g  ‰  ‡  f d †  } |  j  | ƒ } | ƒ  |  j ˆ  d i  f g ƒ d  S(   Nc             s   ˆ  j  |  | f ƒ d  S(   N(   t   append(   R   R	   (   t   _called(    sE   /usr/lib/python2.7/dist-packages/zope/component/tests/test_factory.pyR   6   s    (    (   R
   R   (   R   R   R   (    (   R   sE   /usr/lib/python2.7/dist-packages/zope/component/tests/test_factory.pyt   test___call___no_args4   s
    c            sN   g  ‰  ‡  f d †  } |  j  | ƒ } | d d ƒ |  j ˆ  d i  f g ƒ d  S(   Nc             s   ˆ  j  |  | f ƒ d  S(   N(   R   (   R   R	   (   R   (    sE   /usr/lib/python2.7/dist-packages/zope/component/tests/test_factory.pyR   >   s    t   onet   two(   R    R!   (   R
   R   (   R   R   R   (    (   R   sE   /usr/lib/python2.7/dist-packages/zope/component/tests/test_factory.pyt   test___call___positional_args<   s
    c            sU   g  ‰  ‡  f d †  } |  j  | ƒ } | d d ƒ |  j ˆ  d i d d 6f g ƒ d  S(   Nc             s   ˆ  j  |  | f ƒ d  S(   N(   R   (   R   R	   (   R   (    sE   /usr/lib/python2.7/dist-packages/zope/component/tests/test_factory.pyR   F   s    t   foot   bar(    (   R
   R   (   R   R   R   (    (   R   sE   /usr/lib/python2.7/dist-packages/zope/component/tests/test_factory.pyt   test___call___keyword_argsD   s
    c   	      C   sÑ   d d l  m } d d l  m } d | f d „  ƒ  Y} d | f d „  ƒ  Y} d | f d	 „  ƒ  Y} | | ƒ d
 „  ƒ } |  j | d | | f ƒ} | j ƒ  } |  j | j d ƒ |  j t | ƒ | | g ƒ d  S(   Niÿÿÿÿ(   t	   Interface(   t   implementert   IFooc           B   s   e  Z RS(    (   t   __name__t
   __module__(    (    (    sE   /usr/lib/python2.7/dist-packages/zope/component/tests/test_factory.pyR(   O   s   t   IBarc           B   s   e  Z RS(    (   R)   R*   (    (    (    sE   /usr/lib/python2.7/dist-packages/zope/component/tests/test_factory.pyR+   Q   s   t   IBazc           B   s   e  Z RS(    (   R)   R*   (    (    (    sE   /usr/lib/python2.7/dist-packages/zope/component/tests/test_factory.pyR,   S   s   c           S   s   d  S(   N(    (    (    (    sE   /usr/lib/python2.7/dist-packages/zope/component/tests/test_factory.pyR   U   s    t
   interfacesR   (   t   zope.interfaceR&   R'   R
   t   getInterfacesR   R)   t   list(	   R   R&   R'   R(   R+   R,   R   R   t   spec(    (    sE   /usr/lib/python2.7/dist-packages/zope/component/tests/test_factory.pyt   test_getInterfaces_explicitL   s    c         C   sƒ   d d l  m } d d l  m } d | f d „  ƒ  Y} | | ƒ d „  ƒ } |  j | ƒ } | j ƒ  } |  j t | ƒ | g ƒ d  S(   Niÿÿÿÿ(   R&   (   R'   R,   c           B   s   e  Z RS(    (   R)   R*   (    (    (    sE   /usr/lib/python2.7/dist-packages/zope/component/tests/test_factory.pyR,   `   s   c           S   s   d  S(   N(    (    (    (    sE   /usr/lib/python2.7/dist-packages/zope/component/tests/test_factory.pyR   b   s    (   R.   R&   R'   R
   R/   R   R0   (   R   R&   R'   R,   R   R   R1   (    (    sE   /usr/lib/python2.7/dist-packages/zope/component/tests/test_factory.pyt   test_getInterfaces_implicit]   s    N(   R)   R*   R   R   R
   R   R   R   R   R   R"   R%   R2   R3   (    (    (    sE   /usr/lib/python2.7/dist-packages/zope/component/tests/test_factory.pyR       s   									c          O   s   d  S(   N(    (   R   R	   (    (    sE   /usr/lib/python2.7/dist-packages/zope/component/tests/test_factory.pyR   i   s    c           C   s   t  j t  j t ƒ f ƒ S(   N(   t   unittestt	   TestSuitet	   makeSuiteR    (    (    (    sE   /usr/lib/python2.7/dist-packages/zope/component/tests/test_factory.pyt
   test_suitel   s    (   t   __doc__R4   t   TestCaseR    R   R7   (    (    (    sE   /usr/lib/python2.7/dist-packages/zope/component/tests/test_factory.pyt   <module>   s   V	