ó
ûR‹_c           @   s@   d  d l  m Z d  d l m Z m Z d e f d „  ƒ  YZ d S(   iÿÿÿÿ(   t   TestCase(   t   Replacert   ShouldRaiset   TestReplacerc           B   sY   e  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 } | j ƒ  d k s( t ‚ d „  } t ƒ  } | j d | ƒ | j ƒ  d k sb t ‚ | j ƒ  | j ƒ  d k s„ t ‚ d  S(   Niÿÿÿÿ(   t   sample1s
   original zc           S   s   d S(   Ns   replacement z(    (    (    (    sY   /var/www/syncserver/local/lib/python2.7/site-packages/testfixtures/tests/test_replacer.pyt   test_z   s    s   testfixtures.tests.sample1.zs   replacement z(   t   testfixtures.testsR   t   zt   AssertionErrorR   t   replacet   restore(   t   selfR   R   t   r(    (    sY   /var/www/syncserver/local/lib/python2.7/site-packages/testfixtures/tests/test_replacer.pyt   test_function   s    		
c         C   sÚ   d d l  m } | j ƒ  } | j j d k s4 t ‚ d | j f d „  ƒ  Y} t ƒ  } | j d | ƒ | j ƒ  } | j j d k sŠ t ‚ | j ƒ  j ƒ  d k s¨ t ‚ | j	 ƒ  | j ƒ  } | j j d k sÖ t ‚ d  S(   Niÿÿÿÿ(   R   t   Xt   XReplacementc           B   s   e  Z RS(    (   t   __name__t
   __module__(    (    (    sY   /var/www/syncserver/local/lib/python2.7/site-packages/testfixtures/tests/test_replacer.pyR      s    s   testfixtures.tests.sample1.Xs
   original y(
   R   R   R   t	   __class__R   R   R   R	   t   yR
   (   R   R   t   xR   R   (    (    sY   /var/www/syncserver/local/lib/python2.7/site-packages/testfixtures/tests/test_replacer.pyt
   test_class   s    	
c         C   sž   d d l  m } | j ƒ  j ƒ  d k s. t ‚ d „  } t ƒ  } | j d | ƒ | j ƒ  j ƒ  d  d k sr t ‚ | j ƒ  | j ƒ  j ƒ  d k sš t ‚ d  S(   Niÿÿÿÿ(   R   s
   original yc         S   s   d S(   Ns   replacement y(    (   R   (    (    sY   /var/www/syncserver/local/lib/python2.7/site-packages/testfixtures/tests/test_replacer.pyt   test_y/   s    s   testfixtures.tests.sample1.X.yi&   s   replacement y(   R   R   R   R   R   R   R	   R
   (   R   R   R   R   (    (    sY   /var/www/syncserver/local/lib/python2.7/site-packages/testfixtures/tests/test_replacer.pyt   test_method+   s    		"
c         C   sº   d d l  m } | j } | j j ƒ  | k s4 t ‚ d „  } t ƒ  } | j d | ƒ | j j ƒ  | j j ƒ  | d f k s„ t ‚ | j ƒ  | j j ƒ  | j j ƒ  | k s¶ t ‚ d  S(   Niÿÿÿÿ(   R   c         S   s
   |  d f S(   Ni   (    (   t   cls(    (    sY   /var/www/syncserver/local/lib/python2.7/site-packages/testfixtures/tests/test_replacer.pyt   rMethod@   s    s$   testfixtures.tests.sample1.X.aMethodi   (   R   R   R   t   aMethodR   R   R	   R
   (   R   R   t   cR   R   (    (    sY   /var/www/syncserver/local/lib/python2.7/site-packages/testfixtures/tests/test_replacer.pyt   test_class_method;   s    			!
c         C   sû   d d l  m } | j ƒ  d k s( t ‚ | j ƒ  j ƒ  d k sF t ‚ d „  } d „  } t ƒ  } | j d | ƒ | j d | ƒ | j ƒ  d	 k s™ t ‚ | j ƒ  j ƒ  d
 k s· t ‚ | j ƒ  | j ƒ  d k sÙ t ‚ | j ƒ  j ƒ  d k s÷ t ‚ d  S(   Niÿÿÿÿ(   R   s
   original zs
   original yc         S   s
   |  j  j S(   N(   R   R   (   R   (    (    sY   /var/www/syncserver/local/lib/python2.7/site-packages/testfixtures/tests/test_replacer.pyR   S   s    c           S   s   d S(   Ns   replacement z(    (    (    (    sY   /var/www/syncserver/local/lib/python2.7/site-packages/testfixtures/tests/test_replacer.pyR   U   s    s   testfixtures.tests.sample1.zs   testfixtures.tests.sample1.X.ys   replacement zR   (	   R   R   R   R   R   R   R   R	   R
   (   R   R   R   R   R   (    (    sY   /var/www/syncserver/local/lib/python2.7/site-packages/testfixtures/tests/test_replacer.pyt   test_multiple_replaceN   s    			
c         C   s˜   d d l  m } d d l  m } | j ƒ  d k s8 t ‚ d „  } t ƒ  } | j d | ƒ | j ƒ  d k sr t ‚ | j ƒ  d k sŠ t ‚ | j ƒ  d  S(   Niÿÿÿÿ(   R   (   t   sample2s
   original zc           S   s   d S(   Ns   replacement z(    (    (    (    sY   /var/www/syncserver/local/lib/python2.7/site-packages/testfixtures/tests/test_replacer.pyR   k   s    s   testfixtures.tests.sample1.zs   replacement z(   R   R   R   R   R   R   R	   R
   (   R   R   R   R   R   (    (    sY   /var/www/syncserver/local/lib/python2.7/site-packages/testfixtures/tests/test_replacer.pyt   test_gotchad   s    		c         C   sz   d d l  m } d „  } t ƒ  } | j d | ƒ | j ƒ  | j ƒ  d k sT t ‚ | j ƒ  | j ƒ  d k sv t ‚ d  S(   Niÿÿÿÿ(   R   c           S   s   d  S(   N(    (    (    (    sY   /var/www/syncserver/local/lib/python2.7/site-packages/testfixtures/tests/test_replacer.pyR   |   t    s   testfixtures.tests.sample1.zs
   original z(   R   R   R   R	   R
   R   R   (   R   R   R   R   (    (    sY   /var/www/syncserver/local/lib/python2.7/site-packages/testfixtures/tests/test_replacer.pyt   test_remove_called_twicey   s    		

c         C   s‡   d d l  m } | j ƒ  d k s( t ‚ d „  } t ƒ  / } | j d | ƒ | j ƒ  d k se t ‚ Wd  QX| j ƒ  d k sƒ t ‚ d  S(   Niÿÿÿÿ(   R   s
   original zc           S   s   d S(   Ns   replacement z(    (    (    (    sY   /var/www/syncserver/local/lib/python2.7/site-packages/testfixtures/tests/test_replacer.pyR   ‹   s    s   testfixtures.tests.sample1.zs   replacement z(   R   R   R   R   R   R	   (   R   R   R   R   (    (    sY   /var/www/syncserver/local/lib/python2.7/site-packages/testfixtures/tests/test_replacer.pyt   test_with_statement‡   s    	c         C   sH   d „  } t  ƒ  0 } t t d ƒ ƒ  | j d | ƒ Wd  QXWd  QXd  S(   Nc           S   s   d  S(   N(    (    (    (    sY   /var/www/syncserver/local/lib/python2.7/site-packages/testfixtures/tests/test_replacer.pyt   test_bad•   R    s   Original 'bad' not founds   testfixtures.tests.sample1.bad(   R   R   t   AttributeErrorR	   (   R   R#   R   (    (    sY   /var/www/syncserver/local/lib/python2.7/site-packages/testfixtures/tests/test_replacer.pyt   test_not_there”   s    	(   R   R   R   R   R   R   R   R   R!   R"   R%   (    (    (    sY   /var/www/syncserver/local/lib/python2.7/site-packages/testfixtures/tests/test_replacer.pyR      s   								N(   t   unittestR    t   testfixturesR   R   R   (    (    (    sY   /var/www/syncserver/local/lib/python2.7/site-packages/testfixtures/tests/test_replacer.pyt   <module>   s   