Move make_fake_html_page() elsewhere in the module.

This commit is contained in:
Chris Jerdonek 2019-09-23 05:08:27 -07:00
parent 0a2238ac38
commit d30bc69073
1 changed files with 12 additions and 12 deletions

View File

@ -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