[Python-checkins] CVS: python/dist/src/Lib/test test_repr.py,1.3,1.4
Guido van Rossum
gvanrossum@users.sourceforge.net
Tue, 04 Sep 2001 19:26:28 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv3574
Modified Files:
test_repr.py
Log Message:
Add a test for the final branch in repr.Repr.repr1(), which deals with
a default repr() that's longer than 20 characters.
Index: test_repr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_repr.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** test_repr.py 2001/08/24 18:37:32 1.3
--- test_repr.py 2001/09/05 02:26:26 1.4
***************
*** 79,82 ****
--- 79,87 ----
eq(r(i3), ("<ClassWithFailingRepr instance at %x>"%id(i3)))
+ s = r(ClassWithFailingRepr)
+ self.failUnless(s.startswith("<class "))
+ self.failUnless(s.endswith(">"))
+ self.failUnless(s.find("...") == 8)
+
def test_file(self):
fp = open(unittest.__file__)