summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_repr.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-09-05 02:26:26 (GMT)
committerGuido van Rossum <guido@python.org>2001-09-05 02:26:26 (GMT)
commitcf856f9f28e4a2806fa835fb4e0e54582c0a2edd (patch)
treefd0640e3e6d261d4f10f8335445c6c3d565905cb /Lib/test/test_repr.py
parent785261684e0e660dcdce48daf683cec541f4a8f2 (diff)
downloadcpython-cf856f9f28e4a2806fa835fb4e0e54582c0a2edd.zip
cpython-cf856f9f28e4a2806fa835fb4e0e54582c0a2edd.tar.gz
cpython-cf856f9f28e4a2806fa835fb4e0e54582c0a2edd.tar.bz2
Add a test for the final branch in repr.Repr.repr1(), which deals with
a default repr() that's longer than 20 characters.
Diffstat (limited to 'Lib/test/test_repr.py')
-rw-r--r--Lib/test/test_repr.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_repr.py b/Lib/test/test_repr.py
index 1281b1f..c23fe77 100644
--- a/Lib/test/test_repr.py
+++ b/Lib/test/test_repr.py
@@ -78,6 +78,11 @@ class ReprTests(unittest.TestCase):
i3 = ClassWithFailingRepr()
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__)
self.failUnless(repr(fp).startswith(