summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pydoc.py
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2016-06-03 23:29:18 (GMT)
committerR David Murray <rdmurray@bitdance.com>2016-06-03 23:29:18 (GMT)
commit13ee7d15e3073ca1e602c655ede660a9b1dac01e (patch)
treea3aad5ec8c3d063dd438df83b8ba841acfd8929a /Lib/test/test_pydoc.py
parentcb835d875edd3b89100be1befdbe30dc7d59346f (diff)
parentead9bfc5c392951d8f0d8c537a138df672b762e4 (diff)
downloadcpython-13ee7d15e3073ca1e602c655ede660a9b1dac01e.zip
cpython-13ee7d15e3073ca1e602c655ede660a9b1dac01e.tar.gz
cpython-13ee7d15e3073ca1e602c655ede660a9b1dac01e.tar.bz2
Merge: #16484: Fix pydoc doc links to modules whose names are mixed case.
Diffstat (limited to 'Lib/test/test_pydoc.py')
-rw-r--r--Lib/test/test_pydoc.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py
index 083ba2e..9a357da 100644
--- a/Lib/test/test_pydoc.py
+++ b/Lib/test/test_pydoc.py
@@ -18,6 +18,7 @@ import types
import unittest
import urllib.parse
import xml.etree
+import xml.etree.ElementTree
import textwrap
from io import StringIO
from collections import namedtuple
@@ -352,6 +353,14 @@ def get_pydoc_html(module):
loc = "<br><a href=\"" + loc + "\">Module Docs</a>"
return output.strip(), loc
+def get_pydoc_link(module):
+ "Returns a documentation web link of a module"
+ dirname = os.path.dirname
+ basedir = os.path.join(dirname(dirname(__file__)))
+ doc = pydoc.TextDoc()
+ loc = doc.getdocloc(module, basedir=basedir)
+ return loc
+
def get_pydoc_text(module):
"Returns pydoc generated output as text"
doc = pydoc.TextDoc()
@@ -443,6 +452,11 @@ class PydocDocTest(unittest.TestCase):
doc = pydoc.render_doc(BinaryInteger)
self.assertIn('<BinaryInteger.zero: 0>', doc)
+ def test_mixed_case_module_names_are_lower_cased(self):
+ # issue16484
+ doc_link = get_pydoc_link(xml.etree.ElementTree)
+ self.assertIn('xml.etree.elementtree', doc_link)
+
def test_issue8225(self):
# Test issue8225 to ensure no doc link appears for xml.etree
result, doc_loc = get_pydoc_text(xml.etree)