diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2010-12-03 16:08:46 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2010-12-03 16:08:46 (GMT) |
commit | ecace28ef4486b3fee598e3854431d3a454e30f8 (patch) | |
tree | 7f5c239e6d737a81caae9f3d902dc597ebbf8fe7 /Lib/test | |
parent | 1eb40bc945de17b546006a833022229b2a64d624 (diff) | |
download | cpython-ecace28ef4486b3fee598e3854431d3a454e30f8.zip cpython-ecace28ef4486b3fee598e3854431d3a454e30f8.tar.gz cpython-ecace28ef4486b3fee598e3854431d3a454e30f8.tar.bz2 |
Handle Windows paths and don't double up on HTML header sections in new pydoc URL handler
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_pydoc.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index 60ca12c..7f927f6 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -237,8 +237,10 @@ def print_diffs(text1, text2): print('\n' + ''.join(diffs)) def get_html_title(text): - _, _, text = text.rpartition("<title>") - title, _, _ = text.rpartition("</title>") + # Bit of hack, but good enough for test purposes + header, _, _ = text.partition("</head>") + _, _, title = header.partition("<title>") + title, _, _ = title.partition("</title>") return title @@ -449,7 +451,7 @@ class PyDocUrlHandlerTest(unittest.TestCase): self.assertEqual(result, title) path = string.__file__ - title = "Python: getfile /" + path + title = "Python: getfile " + path url = "getfile?key=" + path text = pydoc._url_handler(url, "text/html") result = get_html_title(text) |