summaryrefslogtreecommitdiff
path: root/Lib/test/test_pydoc.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2010-02-16 23:26:09 +0000
committerEzio Melotti <ezio.melotti@gmail.com>2010-02-16 23:26:09 +0000
commite511fc7979b21a62edf3f85d4eecdc8a9ea2f06a (patch)
treeee6e6b05b94cf33bd94f7c05ecc881c9d017db2b /Lib/test/test_pydoc.py
parent6dfe66298b8a89d04ca94ee5f878a86b59cbc4d9 (diff)
downloadcpython-git-e511fc7979b21a62edf3f85d4eecdc8a9ea2f06a.tar.gz
#7930: fix stripid
Diffstat (limited to 'Lib/test/test_pydoc.py')
-rw-r--r--Lib/test/test_pydoc.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py
index 89f1c22236..5f2d3b33d9 100644
--- a/Lib/test/test_pydoc.py
+++ b/Lib/test/test_pydoc.py
@@ -291,6 +291,19 @@ class PyDocDocTest(unittest.TestCase):
"white space was not stripped from module name "
"or other error output mismatch")
+ def test_stripid(self):
+ # test with strings, other implementations might have different repr()
+ stripid = pydoc.stripid
+ # strip the id
+ self.assertEqual(stripid('<function stripid at 0x88dcee4>'),
+ '<function stripid>')
+ self.assertEqual(stripid('<function stripid at 0x01F65390>'),
+ '<function stripid>')
+ # nothing to strip, return the same text
+ self.assertEqual(stripid('42'), '42')
+ self.assertEqual(stripid("<type 'exceptions.Exception'>"),
+ "<type 'exceptions.Exception'>")
+
class TestDescriptions(unittest.TestCase):