Commit 8b1afebb by Sébastien Eustace

Fix packages with no hashes retrieval for alternative repositories

parent dd444198
# Change Log # Change Log
## [Unreleased]
### Fixed
- Fixed packages with no hashes retrieval for legacy repositories.
## [0.12.15] - 2019-05-03 ## [0.12.15] - 2019-05-03
### Fixed ### Fixed
......
...@@ -359,7 +359,7 @@ class LegacyRepository(PyPiRepository): ...@@ -359,7 +359,7 @@ class LegacyRepository(PyPiRepository):
hash = link.hash hash = link.hash
if link.hash_name == "sha256": if link.hash_name == "sha256":
hashes.append(hash) hashes.append(hash)
else: elif hash:
hashes.append(link.hash_name + ":" + hash) hashes.append(link.hash_name + ":" + hash)
data["digests"] = hashes data["digests"] = hashes
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
</head> </head>
<body> <body>
<h1>Links for jupyter</h1> <h1>Links for jupyter</h1>
<a href="https://files.pythonhosted.org/packages/c9/a9/371d0b8fe37dd231cf4b2cff0a9f0f25e98f3a73c3771742444be27f2944/jupyter-1.0.0.tar.gz#sha256=d9dc4b3318f310e34c82951ea5d6683f67bed7def4b259fafbfe4f1beb1d8e5f">jupyter-1.0.0.tar.gz</a><br/> <a href="https://files.pythonhosted.org/packages/c9/a9/371d0b8fe37dd231cf4b2cff0a9f0f25e98f3a73c3771742444be27f2944/jupyter-1.0.0.tar.gz">jupyter-1.0.0.tar.gz</a><br/>
</body> </body>
</html> </html>
<!--SERIAL 1673841--> <!--SERIAL 1673841-->
...@@ -245,3 +245,11 @@ def test_get_package_retrieves_non_sha256_hashes(): ...@@ -245,3 +245,11 @@ def test_get_package_retrieves_non_sha256_hashes():
] ]
assert expected == package.hashes assert expected == package.hashes
def test_get_package_retrieves_packages_with_no_hashes():
repo = MockRepository()
package = repo.package("jupyter", "1.0.0")
assert [] == package.hashes
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment