Skip to content

Commit 0760fa5

Browse files
committed
add back test
1 parent d2edaad commit 0760fa5

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

tests/test_package_index.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,23 @@ def test_project_info_from_simple_html(name):
5656
_check_project_info(info)
5757

5858

59+
@pytest.mark.parametrize("name", ["black"])
60+
def test_project_info_no_base_from_simple_html(name):
61+
"""
62+
This test that the black_simple.html.gz does not have
63+
absolute url, we test that if we don't pass the https:// domain,
64+
t_check_project_info will indeed fail.
65+
"""
66+
test_file = TEST_PYPI_RESPONSE_DIR / f"{name}_simple.html.gz"
67+
test_data = _read_gzipped_testfile(test_file)
68+
69+
info = package_index.ProjectInfo.from_simple_html_api(
70+
test_data.decode("utf-8"), name, index_base_url="no_base"
71+
)
72+
with pytest.raises(AssertionError):
73+
_check_project_info(info)
74+
75+
5976
@pytest.mark.parametrize(
6077
"name", ["numpy", "black", "pytest", "snowballstemmer", "pytz"]
6178
)

0 commit comments

Comments
 (0)