diff options
author | Stéphane Bidoul <stephane.bidoul@gmail.com> | 2023-04-07 23:03:03 +0200 |
---|---|---|
committer | Stéphane Bidoul <stephane.bidoul@gmail.com> | 2023-04-07 23:07:01 +0200 |
commit | 6e5d4678220063f7d0feae82ff9cb970252beb76 (patch) | |
tree | 66832c6b1addaa76a2c509843c1ed4973e1d3ed1 /tests | |
parent | 81f6a9fcc6eb846c58044de61c04b95e90b96a7a (diff) | |
download | pip-6e5d4678220063f7d0feae82ff9cb970252beb76.tar.gz |
Various fixes to the link hash parser
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/test_collector.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/unit/test_collector.py b/tests/unit/test_collector.py index 26a2ce4b9..5f949d14d 100644 --- a/tests/unit/test_collector.py +++ b/tests/unit/test_collector.py @@ -1052,6 +1052,18 @@ def test_link_collector_create_find_links_expansion( LinkHash("sha256", "aa113592bbe"), ), ( + "https://pypi.org/pip-18.0.tar.gz#sha256=aa113592bbe&subdirectory=setup", + LinkHash("sha256", "aa113592bbe"), + ), + ( + "https://pypi.org/pip-18.0.tar.gz#subdirectory=setup&sha256=aa113592bbe", + LinkHash("sha256", "aa113592bbe"), + ), + # "xsha256" is not a valid algorithm, so we discard it. + ("https://pypi.org/pip-18.0.tar.gz#xsha256=aa113592bbe", None), + # Discard empty hash. + ("https://pypi.org/pip-18.0.tar.gz#sha256=", None), + ( "https://pypi.org/pip-18.0.tar.gz#md5=aa113592bbe", LinkHash("md5", "aa113592bbe"), ), |