summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2010-12-03 16:08:46 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2010-12-03 16:08:46 (GMT)
commitecace28ef4486b3fee598e3854431d3a454e30f8 (patch)
tree7f5c239e6d737a81caae9f3d902dc597ebbf8fe7 /Lib/test
parent1eb40bc945de17b546006a833022229b2a64d624 (diff)
downloadcpython-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.py8
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)