mirror of
https://github.com/python/cpython.git
synced 2025-07-19 09:15:34 +00:00
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 ........
This commit is contained in:
parent
19ed3c8bf5
commit
412c95a485
2 changed files with 14 additions and 3 deletions
|
@ -306,6 +306,19 @@ class PyDocDocTest(unittest.TestCase):
|
|||
expected = missing_pattern % missing_module.strip()
|
||||
self.assertEqual(expected, result)
|
||||
|
||||
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):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue