ķ
ž?Tū  c           @   sī   d  d l  Z d  d l j j Z d  d l m Z d  d l m	 Z	 d  d l
 m Z d  d l m Z m Z d  d l m Z d d l m Z m Z d	 e f d
     YZ d e f d     YZ d e f d     YZ d e f d     YZ d   Z d S(   i˙˙˙˙N(   t   Manager(   t   handler(   t   BaseComponent(   t
   BaseServert
   Controller(   t
   Dispatcheri   (   t   urlopent   urljoint   PrefixingDispatcherc           B   s2   e  Z d  Z d   Z e d d d d    Z RS(   s3   Forward to another Dispatcher based on the channel.c         C   s   t  t |   j d |  d  S(   Nt   channel(   t   superR   t   __init__(   t   selfR	   (    (    s4   /home/prologic/work/circuits/tests/web/test_disps.pyR      s    t   requestt   priorityg      đ?c         C   s5   | j  j d  } t d |  j |  } | | _  d  S(   Nt   /s   /%s/(   t   patht   stripR   R	   (   R   t   eventR   t   responseR   (    (    s4   /home/prologic/work/circuits/tests/web/test_disps.pyt   _on_request   s    (   t   __name__t
   __module__t   __doc__R   R   R   (    (    (    s4   /home/prologic/work/circuits/tests/web/test_disps.pyR      s   	t	   DummyRootc           B   s   e  Z d  Z d   Z RS(   R   c         C   s   d S(   Ns   Not used(    (   R   (    (    s4   /home/prologic/work/circuits/tests/web/test_disps.pyt   index   s    (   R   R   R	   R   (    (    (    s4   /home/prologic/work/circuits/tests/web/test_disps.pyR      s   t   Root1c           B   s   e  Z d  Z d   Z RS(   s   /site1c         C   s   d S(   Ns   Hello from site 1!(    (   R   (    (    s4   /home/prologic/work/circuits/tests/web/test_disps.pyR   '   s    (   R   R   R	   R   (    (    (    s4   /home/prologic/work/circuits/tests/web/test_disps.pyR   #   s   t   Root2c           B   s   e  Z d  Z d   Z RS(   s   /site2c         C   s   d S(   Ns   Hello from site 2!(    (   R   (    (    s4   /home/prologic/work/circuits/tests/web/test_disps.pyR   /   s    (   R   R   R	   R   (    (    (    s4   /home/prologic/work/circuits/tests/web/test_disps.pyR   +   s   c    	      C   s  t    }  t d d d } | j |   t d d  j |  t d d  j |  t   j |   t d d d } | j |   t d d  j |  t d d  j |  t   j |   t   j |   |  j   t	 | j
 j d d } | j   } d } | | k } | sĒt j d | f d | | f  i t j |  d 6d t j   k sgt j |  rvt j |  n d d 6} d i | d 6} t t j |    n  d  } } t	 | j
 j d d } | j   } d } | | k } | st j d | f d | | f  i t j |  d 6d t j   k sBt j |  rQt j |  n d d 6} d i | d 6} t t j |    n  d  } } d  S(   Ni    R	   t   site1t	   localhostt   site2t   timeouti   s   Hello from site 1!s   ==s   %(py0)s == %(py3)st   py3t   st   py0t    s   assert %(py5)st   py5s   Hello from site 2!(   s	   localhosti    (   s   ==(   s   %(py0)s == %(py3)ss   assert %(py5)s(   s   ==(   s   %(py0)s == %(py3)ss   assert %(py5)s(   R    R   t   registerR   R   R   R   R   t   startR   t   httpt   baset   readt
   @pytest_art   _call_reprcomparet	   _safereprt   @py_builtinst   localst   _should_repr_global_namet   AssertionErrort   _format_explanationt   None(	   t   managert   server1t   server2t   fR!   t   @py_assert2t   @py_assert1t   @py_format4t   @py_format6(    (    s4   /home/prologic/work/circuits/tests/web/test_disps.pyt
   test_disps3   s>    	
   l   
   l   (   t   __builtin__R-   t   _pytest.assertion.rewritet	   assertiont   rewriteR*   t   circuits.core.managerR    t   circuits.core.handlersR   t   circuits.core.componentsR   t   circuits.webR   R   t#   circuits.web.dispatchers.dispatcherR   t   helpersR   R   R   R   R   R   R;   (    (    (    s4   /home/prologic/work/circuits/tests/web/test_disps.pyt   <module>   s     