13
13
14
14
from pip ._internal .exceptions import NetworkConnectionError
15
15
from pip ._internal .index .collector import (
16
- HTMLPage ,
16
+ IndexContent ,
17
17
LinkCollector ,
18
18
_clean_link ,
19
19
_clean_url_path ,
@@ -426,7 +426,7 @@ def _test_parse_links_data_attribute(
426
426
"<body>{}</body></html>"
427
427
).format (anchor_html )
428
428
html_bytes = html .encode ("utf-8" )
429
- page = HTMLPage (
429
+ page = IndexContent (
430
430
html_bytes ,
431
431
encoding = None ,
432
432
# parse_links() is cached by url, so we inject a random uuid to ensure
@@ -503,22 +503,22 @@ def test_parse_links_caches_same_page_by_url() -> None:
503
503
504
504
url = "https://example.com/simple/"
505
505
506
- page_1 = HTMLPage (
506
+ page_1 = IndexContent (
507
507
html_bytes ,
508
508
encoding = None ,
509
509
url = url ,
510
510
)
511
511
# Make a second page with zero content, to ensure that it's not accessed,
512
512
# because the page was cached by url.
513
- page_2 = HTMLPage (
513
+ page_2 = IndexContent (
514
514
b"" ,
515
515
encoding = None ,
516
516
url = url ,
517
517
)
518
518
# Make a third page which represents an index url, which should not be
519
519
# cached, even for the same url. We modify the page content slightly to
520
520
# verify that the result is not cached.
521
- page_3 = HTMLPage (
521
+ page_3 = IndexContent (
522
522
re .sub (b"pkg1" , b"pkg2" , html_bytes ),
523
523
encoding = None ,
524
524
url = url ,
@@ -541,7 +541,7 @@ def test_parse_links_caches_same_page_by_url() -> None:
541
541
def test_parse_link_handles_deprecated_usage_properly () -> None :
542
542
html = b'<a href="/pkg1-1.0.tar.gz"></a><a href="/pkg1-2.0.tar.gz"></a>'
543
543
url = "https://example.com/simple/"
544
- page = HTMLPage (html , encoding = None , url = url , cache_link_parsing = False )
544
+ page = IndexContent (html , encoding = None , url = url , cache_link_parsing = False )
545
545
546
546
parsed_links = list (parse_links (page , use_deprecated_html5lib = True ))
547
547
0 commit comments