From f5ab3e88b0510fcb2a896212d69fa47d2d606f86 Mon Sep 17 00:00:00 2001 From: Donald Stufft Date: Sat, 25 Jun 2022 14:23:00 -0400 Subject: [PATCH] Fix tests --- tests/unit/test_collector.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/unit/test_collector.py b/tests/unit/test_collector.py index 868a13b03b2..7c77a40dfb9 100644 --- a/tests/unit/test_collector.py +++ b/tests/unit/test_collector.py @@ -13,7 +13,7 @@ from pip._internal.exceptions import NetworkConnectionError from pip._internal.index.collector import ( - HTMLPage, + IndexContent, LinkCollector, _clean_link, _clean_url_path, @@ -426,7 +426,7 @@ def _test_parse_links_data_attribute( "{}" ).format(anchor_html) html_bytes = html.encode("utf-8") - page = HTMLPage( + page = IndexContent( html_bytes, encoding=None, # parse_links() is cached by url, so we inject a random uuid to ensure @@ -503,14 +503,14 @@ def test_parse_links_caches_same_page_by_url() -> None: url = "https://example.com/simple/" - page_1 = HTMLPage( + page_1 = IndexContent( html_bytes, encoding=None, url=url, ) # Make a second page with zero content, to ensure that it's not accessed, # because the page was cached by url. - page_2 = HTMLPage( + page_2 = IndexContent( b"", encoding=None, url=url, @@ -518,7 +518,7 @@ def test_parse_links_caches_same_page_by_url() -> None: # Make a third page which represents an index url, which should not be # cached, even for the same url. We modify the page content slightly to # verify that the result is not cached. - page_3 = HTMLPage( + page_3 = IndexContent( re.sub(b"pkg1", b"pkg2", html_bytes), encoding=None, url=url, @@ -541,7 +541,7 @@ def test_parse_links_caches_same_page_by_url() -> None: def test_parse_link_handles_deprecated_usage_properly() -> None: html = b'' url = "https://example.com/simple/" - page = HTMLPage(html, encoding=None, url=url, cache_link_parsing=False) + page = IndexContent(html, encoding=None, url=url, cache_link_parsing=False) parsed_links = list(parse_links(page, use_deprecated_html5lib=True))