ó
ź=Nc           @   s   d  d l  m Z d  d l m Z d  d l m Z d d d     YZ d d d     YZ d e f d	     YZ d
 e j	 f d     YZ
 d S(   i’’’’(   t   unittest(   t   service(   t   LocalAsRemotet   Dummyc           B   s   e  Z RS(    (   t   __name__t
   __module__(    (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_manhole.pyR   
   s   t   DummyTransportc           B   s   e  Z d    Z RS(   c         C   s   d S(   Nt   INETs	   127.0.0.1i    (   R   s	   127.0.0.1i    (    (   t   self(    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_manhole.pyt   getHost   s    (   R   R   R	   (    (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_manhole.pyR      s   t   DummyManholeClientc           B   sh   e  Z d  Z e   Z e   e _ d   Z d   Z d   Z	 d   Z
 d   Z e Z e	 Z e
 Z e Z RS(   i    c         C   s   g  |  _  d  S(   N(   t   messages(   R   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_manhole.pyt   __init__   s    c         C   s   |  j  j |  d  S(   N(   R   t   extend(   R   R   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_manhole.pyt   console   s    c         C   s   d  S(   N(    (   R   t   xplorer(    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_manhole.pyt   receiveExplorer   s    c         C   s   t  |  j  |  _ d  S(   N(   t   lenR   t   zero(   R   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_manhole.pyt   setZero   s    c         C   s   |  j  |  j S(   N(   R   R   (   R   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_manhole.pyt   getMessages"   s    (   R   R   R   R   t   brokerR   t	   transportR   R   R   R   R   t   sync_consolet   sync_receiveExplorert   sync_setZerot   sync_getMessages(    (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_manhole.pyR
      s   						t   ManholeTestc           B   s)   e  Z d  Z d   Z d   Z d   Z RS(   sĄ   Various tests for the manhole service.

    Both the the importIdentity and importMain tests are known to fail
    when the __name__ in the manhole namespace is set to certain
    values.
    c         C   sJ   t  j   |  _  t  j |  j   |  _ t   |  _ |  j j |  j d   d  S(   N(   R   t   Servicet   Perspectivet   pR
   t   clientt   attachedt   None(   R   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_manhole.pyt   setUp2   s    c         C   sT   |  j  j d  |  j j   |  j  j d  |  j j   d } |  j | d  d S(   sJ   Making sure imported module is the same as one previously loaded.
        s#   from twisted.manhole import services6   int(service is sys.modules['twisted.manhole.service'])i    t   results   1
N(   s   results   1
(   R   t   perspective_doR   R   R   t   assertEqual(   R   t   msg(    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_manhole.pyt   test_importIdentity8   s
    c         C   sj   |  j  j   |  j j d  |  j  j   rf |  j  j   d } | d d k rf |  j | d  qf n  d S(   s   Trying to import __main__s   import __main__i    t	   exceptiont   stderri   N(   R(   s   stderr(   R   R   R   R$   R   t   fail(   R   R&   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_manhole.pyt   test_importMainA   s    (   R   R   t   __doc__R"   R'   R+   (    (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_manhole.pyR   +   s   			N(    (    (   t   twisted.trialR    t   twisted.manholeR   t   twisted.spread.utilR   R   R   R
   t   TestCaseR   (    (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_manhole.pyt   <module>   s   