-í
é¶<c       sÖ   d  Z  d k Z d k Z d k Z d k l Z d k l Z d „  Z d e i	 f d „  ƒ  YZ
 d d „ Z d	 „  Z d
 e i	 f d „  ƒ  YZ d f  d „  ƒ  YZ d f  d „  ƒ  YZ d „  Z e d j o e ƒ  n d S(   s3   
  Test cases for the repr module
  Nick Mathewson
N(   s   run_unittest(   s   reprc    s.   f  } x t |  ƒ D] } | f } q W| Sd  S(   N(   s   ts   ranges   nestings   i(   s   nestings   is   t(    (    s$   /usr/lib/python2.2/test/test_repr.pys   nestedTuple s
     s	   ReprTestsc      st   t  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d	 „  Z
 d
 „  Z d „  Z d „  Z RS(   Nc    sÆ   |  i } | t d ƒ d ƒ | t d ƒ d ƒ d d d d } | d  d	 | d
 } | t | ƒ | ƒ | t d ƒ t d ƒ ƒ d d d d } | d  d	 | d
 } | t | ƒ | ƒ d  S(   Ns   abcs   'abc's   abcdefghijklmnops   'abcdefghijklmnop's   ai   s   bi   s   ...iòÿÿÿs   "'s   "s   'id   (   s   selfs   assertEqualss   eqs   rs   ss   expecteds   repr(   s   selfs   ss   expecteds   eq(    (    s$   /usr/lib/python2.2/test/test_repr.pys   test_string s    	c  	  sž  |  i } | t f  ƒ d ƒ | t d f ƒ d ƒ | t d d d f ƒ d ƒ | t d d d d d d	 f ƒ d
 ƒ | t d d d d d d	 d f ƒ d ƒ | t g  ƒ d ƒ | t d g ƒ d ƒ | t d d d g ƒ d ƒ | t d d d d d d	 g ƒ d ƒ | t d d d d d d	 d g ƒ d ƒ | t h  ƒ d ƒ h  d d <d d <d d <d d <} | t | ƒ d ƒ d | d <| t | ƒ d ƒ d  S(   Ns   ()i   s   (1,)i   i   s	   (1, 2, 3)i   i   i   s   (1, 2, 3, 4, 5, 6)i   s   (1, 2, 3, 4, 5, 6, ...)s   []s   [1]s	   [1, 2, 3]s   [1, 2, 3, 4, 5, 6]s   [1, 2, 3, 4, 5, 6, ...]s   {}s   alices   bobs   charless   daves/   {'alice': 1, 'bob': 2, 'charles': 3, 'dave': 4}s   arthurs6   {'alice': 1, 'arthur': 1, 'bob': 2, 'charles': 3, ...}(   s   selfs   assertEqualss   eqs   rs   d(   s   selfs   eqs   d(    (    s$   /usr/lib/python2.2/test/test_repr.pys   test_container$ s     	%(%(*
c    s•   |  i } | t d ƒ t d ƒ ƒ | t d ƒ t d ƒ ƒ | t d d ƒ t d d ƒ ƒ d d } | d  d | d	 } | t | ƒ | ƒ d  S(
   Ni{   l   { f1.0i   l   
 id   i   s   ...iíÿÿÿ(   s   selfs   assertEqualss   eqs   rs   reprs   ns   expected(   s   selfs   expecteds   eqs   n(    (    s$   /usr/lib/python2.2/test/test_repr.pys   test_numbers; s    	!
c    sç   |  i } t d ƒ } | t | ƒ t | ƒ ƒ t d d ƒ } | d  d | d } | t | ƒ | ƒ t	 ƒ  } | t | ƒ d t | ƒ ƒ t t	 ƒ } |  i | i d ƒ ƒ |  i | i d	 ƒ ƒ |  i | i d ƒ d
 j ƒ d  S(   Ns   as   xiè  i   s   ...iòÿÿÿs%   <ClassWithFailingRepr instance at %x>s   <class s   >i   (   s   selfs   assertEqualss   eqs   ClassWithReprs   i1s   rs   reprs   i2s   expecteds   ClassWithFailingReprs   i3s   ids   ss
   failUnlesss
   startswiths   endswiths   find(   s   selfs   i1s   i3s   i2s   ss   expecteds   eq(    (    s$   /usr/lib/python2.2/test/test_repr.pys   test_instanceE s    		c    sc   t  t i ƒ } |  i t | ƒ i d t i ƒ ƒ | i ƒ  |  i t | ƒ i d t i ƒ ƒ d  S(   Ns   <open file '%s', mode 'r' at 0xs!   <closed file '%s', mode 'r' at 0x(	   s   opens   unittests   __file__s   fps   selfs
   failUnlesss   reprs
   startswiths   close(   s   selfs   fp(    (    s$   /usr/lib/python2.2/test/test_repr.pys	   test_fileV s    #
c    s#   |  i t d „  ƒ i d ƒ ƒ d  S(   Nc    s   |  S(   N(   s   x(   s   x(    (    s$   /usr/lib/python2.2/test/test_repr.pys   <lambda>_ s    s   <function <lambda(   s   selfs
   failUnlesss   reprs
   startswith(   s   self(    (    s$   /usr/lib/python2.2/test/test_repr.pys   test_lambda^ s    c    s?   |  i } | t t ƒ d ƒ |  i t d i ƒ i d ƒ ƒ d  S(   Ns   <built-in function hash>s    s*   <built-in method split of str object at 0x(   s   selfs   assertEqualss   eqs   reprs   hashs
   failUnlesss   splits
   startswith(   s   selfs   eq(    (    s$   /usr/lib/python2.2/test/test_repr.pys   test_builtin_functionc s    	c    s£   |  i } | t t d ƒ ƒ d ƒ | t t d d ƒ ƒ d ƒ | t t d d d ƒ ƒ d ƒ d  k } | i d d t d	 t i	 ƒ| t t d ƒ d ƒ d
 ƒ d  S(   Ni   s	   xrange(1)i   s   xrange(1, 2)i   s   xrange(1, 4, 3)s   ignores   categorys   modules   (xrange(1) * 3)(
   s   selfs   assertEqualss   eqs   reprs   xranges   warningss   filterwarningss   DeprecationWarnings	   ReprTestss
   __module__(   s   selfs   warningss   eq(    (    s$   /usr/lib/python2.2/test/test_repr.pys   test_xrangek s    		c    s)  |  i } | t g  g g g g g g ƒ d ƒ | t g  g g g g g g g ƒ d ƒ | t t d ƒ ƒ d ƒ | t t d ƒ ƒ d ƒ | t h  t d ƒ t d ƒ <ƒ d ƒ | t h  t d ƒ t d ƒ <ƒ d	 ƒ | t h  g g g g g g ƒ d
 ƒ | t h  g g g g g g g ƒ d ƒ d  S(   Ns   [[[[[[[]]]]]]]s   [[[[[[[...]]]]]]]i   s   (((((((),),),),),),)i   s   (((((((...),),),),),),)i   s&   {((((((),),),),),): ((((((),),),),),)}s,   {((((((...),),),),),): ((((((...),),),),),)}s   [[[[[[{}]]]]]](   s   selfs   assertEqualss   eqs   rs   nestedTuple(   s   selfs   eq(    (    s$   /usr/lib/python2.2/test/test_repr.pys   test_nestingv s    	%(!!%c    s,   t  d ƒ } |  i t | ƒ i d ƒ ƒ d  S(   Ns   foos   <read-only buffer for 0x(   s   buffers   xs   selfs
   failUnlesss   reprs
   startswith(   s   selfs   x(    (    s$   /usr/lib/python2.2/test/test_repr.pys   test_buffer‡ s    c    s   d  S(   N(    (   s   self(    (    s$   /usr/lib/python2.2/test/test_repr.pys	   test_cell s    c    sŒ   |  i } | t t i ƒ d ƒ d f  d „  ƒ  Y} t | i ƒ } |  i
 t | ƒ i d ƒ ƒ t | i ƒ } |  i
 t | ƒ i d ƒ ƒ d  S(   Ns"   <method 'items' of 'dict' objects>s   Cc      s   t  Z d „  Z RS(   Nc    s   d  S(   N(    (   s   cls(    (    s$   /usr/lib/python2.2/test/test_repr.pys   fooš s    (   s   __name__s
   __module__s   foo(    (    (    s$   /usr/lib/python2.2/test/test_repr.pys   C™ s   s   <staticmethod object at 0xs   <classmethod object at 0x(   s   selfs   assertEqualss   eqs   reprs   dicts   itemss   Cs   staticmethods   foos   xs
   failUnlesss
   startswiths   classmethod(   s   selfs   Cs   xs   eq(    (    s$   /usr/lib/python2.2/test/test_repr.pys   test_descriptors‘ s    	(   s   __name__s
   __module__s   test_strings   test_containers   test_numberss   test_instances	   test_files   test_lambdas   test_builtin_functions   test_xranges   test_nestings   test_buffers	   test_cells   test_descriptors(    (    (    s$   /usr/lib/python2.2/test/test_repr.pys	   ReprTests s   			
								s    c    s*   t  |  d ƒ } | i | ƒ | i ƒ  d  S(   Ns   w(   s   opens   paths   fps   writes   texts   close(   s   paths   texts   fp(    (    s$   /usr/lib/python2.2/test/test_repr.pys   touch  s    c    s1   x* | D]" } |  i t i i | | ƒ ƒ q Wd  S(   N(   s   namess   names   actionss   appends   oss   paths   joins   dirname(   s   actionss   dirnames   namess   name(    (    s$   /usr/lib/python2.2/test/test_repr.pys   zap¥ s     s   LongReprTestc      sY   t  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d	 „  Z
 RS(
   Nc    sÊ   d } t i i | ƒ |  _ t i i | | ƒ |  _ t i |  i ƒ t t i i |  i d t i	 d ƒ ƒ t i |  i ƒ t t i i |  i d t i	 d ƒ ƒ t i
 ƒ  |  _ t i i d |  i ƒ d  S(   Ns3   areallylongpackageandmodulenametotestreprtruncations   __init__s   pyi    (   s   longnames   oss   paths   joins   selfs   pkgnames
   subpkgnames   mkdirs   touchs   extseps   getcwds   heres   syss   insert(   s   selfs   longname(    (    s$   /usr/lib/python2.2/test/test_repr.pys   setUpª s    ''c    s“   g  } t i i |  i t | ƒ | i |  i ƒ | i ƒ  | i	 ƒ  x? | D]7 } t i i | ƒ o t i | ƒ n t i | ƒ qJ Wt i d =d  S(   Ni    (   s   actionss   oss   paths   walks   selfs   pkgnames   zaps   appends   sorts   reverses   ps   isdirs   rmdirs   removes   sys(   s   selfs   ps   actions(    (    s$   /usr/lib/python2.2/test/test_repr.pys   tearDown· s    

 c    s^   |  i } t t i i |  i |  i t i	 d ƒ ƒ d k
 l } | t | ƒ d | i ƒ d  S(   Ns   py(   s3   areallylongpackageandmodulenametotestreprtruncations°   <module 'areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation' from '%s'>(   s   selfs   assertEqualss   eqs   touchs   oss   paths   joins
   subpkgnames   pkgnames   extsepsg   areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncations3   areallylongpackageandmodulenametotestreprtruncations   reprs   __file__(   s   selfs3   areallylongpackageandmodulenametotestreprtruncations   eq(    (    s$   /usr/lib/python2.2/test/test_repr.pys   test_moduleÄ s
    	*c    sZ   |  i } t t i i |  i d t i d ƒ d ƒ d k	 l
 } | t | i
 ƒ d ƒ d  S(   Ns   foos   pys   class foo(object):
    pass
(   s   foosy   <class 'areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation.foo.foo'>(   s   selfs   assertEqualss   eqs   touchs   oss   paths   joins
   subpkgnames   extsepsg   areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncations   foos   repr(   s   selfs   eqs   foo(    (    s$   /usr/lib/python2.2/test/test_repr.pys	   test_typeË s    	#c    s   d  S(   N(    (   s   self(    (    s$   /usr/lib/python2.2/test/test_repr.pys   test_objectÕ s    c    sZ   t  t i i |  i d t i d ƒ d ƒ d k l } |  i	 t
 | i ƒ i d ƒ ƒ d  S(   Ns   bars   pys   class bar:
    pass
(   s   bars|   <class areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation.bar.bar at 0x(   s   touchs   oss   paths   joins   selfs
   subpkgnames   extsepsg   areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncations   bars
   failUnlesss   reprs
   startswith(   s   selfs   bar(    (    s$   /usr/lib/python2.2/test/test_repr.pys
   test_classÚ s    #c    sc   t  t i i |  i d t i d ƒ d ƒ d k l } | i ƒ  } |  i
 t | ƒ i d ƒ ƒ d  S(   Ns   bazs   pys   class baz:
    pass
(   s   bazs   <areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation.baz.baz instance at 0x(   s   touchs   oss   paths   joins   selfs
   subpkgnames   extsepsg   areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncations   bazs   ibazs
   failUnlesss   reprs
   startswith(   s   selfs   ibazs   baz(    (    s$   /usr/lib/python2.2/test/test_repr.pys   test_instanceã s
    #c    sˆ   |  i } t t i i |  i d t i d ƒ d ƒ d k	 l
 } | t | i i ƒ d ƒ | i ƒ  } |  i t | i ƒ i d ƒ ƒ d  S(   Ns   quxs   pysì   class aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:
    def amethod(self): pass
(   s   quxsá   <unbound method aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.amethod>s&  <bound method aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.amethod of <areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation.qux.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa instance at 0x(   s   selfs   assertEqualss   eqs   touchs   oss   paths   joins
   subpkgnames   extsepsg   areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncations   quxs   reprsÈ   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaas   amethods   iquxs
   failUnlesss
   startswith(   s   selfs   quxs   eqs   iqux(    (    s$   /usr/lib/python2.2/test/test_repr.pys   test_methodí s    	#c    s   d  S(   N(    (   s   self(    (    s$   /usr/lib/python2.2/test/test_repr.pys   test_builtin_functionü s    (   s   __name__s
   __module__s   setUps   tearDowns   test_modules	   test_types   test_objects
   test_classs   test_instances   test_methods   test_builtin_function(    (    (    s$   /usr/lib/python2.2/test/test_repr.pys   LongReprTest© s   				
				
	s   ClassWithReprc      s   t  Z d „  Z d „  Z RS(   Nc    s   | |  _  d  S(   N(   s   ss   self(   s   selfs   s(    (    s$   /usr/lib/python2.2/test/test_repr.pys   __init__s    c    s   d |  i Sd  S(   Ns   ClassWithLongRepr(%r)(   s   selfs   s(   s   self(    (    s$   /usr/lib/python2.2/test/test_repr.pys   __repr__s    (   s   __name__s
   __module__s   __init__s   __repr__(    (    (    s$   /usr/lib/python2.2/test/test_repr.pys   ClassWithRepr s   	s   ClassWithFailingReprc      s   t  Z d „  Z RS(   Nc    s   t  d ƒ ‚ d  S(   Ns+   This should be caught by Repr.repr_instance(   s	   Exception(   s   self(    (    s$   /usr/lib/python2.2/test/test_repr.pys   __repr__s    (   s   __name__s
   __module__s   __repr__(    (    (    s$   /usr/lib/python2.2/test/test_repr.pys   ClassWithFailingReprs   c      s,   t  t ƒ t i d j o t  t ƒ n d  S(   Ns   mac(   s   run_unittests	   ReprTestss   oss   names   LongReprTest(    (    (    s$   /usr/lib/python2.2/test/test_repr.pys	   test_mains    
s   __main__(   s   __doc__s   syss   oss   unittests   test_supports   run_unittests   reprs   rs   nestedTuples   TestCases	   ReprTestss   touchs   zaps   LongReprTests   ClassWithReprs   ClassWithFailingReprs	   test_mains   __name__(   s   nestedTuples	   ReprTestss   unittests   LongReprTests   syss   run_unittests   rs   ClassWithReprs	   test_mains   touchs   ClassWithFailingReprs   oss   zap(    (    s$   /usr/lib/python2.2/test/test_repr.pys   ? s   				Œ	W	