提交 d30bc690 编写于 作者: C Chris Jerdonek

Move make_fake_html_page() elsewhere in the module.

上级 0a2238ac
......@@ -324,6 +324,18 @@ def test_get_html_page_invalid_scheme(caplog, url, vcs_scheme):
]
def make_fake_html_page(url):
html = dedent(u"""\
<html><head><meta name="api-version" value="2" /></head>
<body>
<a href="/abc-1.0.tar.gz#md5=000000000">abc-1.0.tar.gz</a>
</body></html>
""")
content = html.encode('utf-8')
headers = {}
return HTMLPage(content, url=url, headers=headers)
def test_get_html_page_directory_append_index(tmpdir):
"""`_get_html_page()` should append "index.html" to a directory URL.
"""
......@@ -371,18 +383,6 @@ def test_group_locations__non_existing_path():
assert not urls and not files, "nothing should have been found"
def make_fake_html_page(url):
html = dedent(u"""\
<html><head><meta name="api-version" value="2" /></head>
<body>
<a href="/abc-1.0.tar.gz#md5=000000000">abc-1.0.tar.gz</a>
</body></html>
""")
content = html.encode('utf-8')
headers = {}
return HTMLPage(content, url=url, headers=headers)
def check_links_include(links, names):
"""
Assert that the given list of Link objects includes, for each of the
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册