diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2010-02-16 23:29:44 +0000 |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2010-02-16 23:29:44 +0000 |
commit | 5f943ed1338f9c4df4602c0d64faf4e34eebe708 (patch) | |
tree | 0a7ad9eb40f72d27408ee8e1584a1ef61e0cd32c /Lib/test/test_pydoc.py | |
parent | 4c5e2c8e98292baa0894cf7e5b3a4cba6808a2c9 (diff) | |
download | cpython-git-5f943ed1338f9c4df4602c0d64faf4e34eebe708.tar.gz |
Merged revisions 78207 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r78207 | ezio.melotti | 2010-02-17 01:26:09 +0200 (Wed, 17 Feb 2010) | 1 line
#7930: fix stripid
........
Diffstat (limited to 'Lib/test/test_pydoc.py')
-rw-r--r-- | Lib/test/test_pydoc.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index ea66d262ea..168c4d135a 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -288,6 +288,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): |