@@ -44,7 +44,7 @@ def test_simple_json_detail_api(
4444 repo = python_repo_with_sync (remote )
4545 distro = python_distribution_factory (repository = repo )
4646
47- url = f'{ urljoin (distro .base_url , "simple/" )} aiohttp '
47+ url = f'{ urljoin (distro .base_url , "simple/" )} django '
4848 headers = {"Accept" : PYPI_SIMPLE_V1_JSON }
4949
5050 response = requests .get (url , headers = headers )
@@ -53,17 +53,30 @@ def test_simple_json_detail_api(
5353
5454 data = response .json ()
5555 assert data ["meta" ] == {"api-version" : API_VERSION , "_last-serial" : PYPI_SERIAL_CONSTANT }
56- assert data ["name" ] == "aiohttp "
56+ assert data ["name" ] == "django "
5757 assert data ["files" ]
58- for file in data ["files" ]:
59- for i in [
60- "filename" ,
61- "url" ,
62- "hashes" ,
63- "data-dist-info-metadata" ,
64- "requires_python" ,
65- ]:
66- assert i in file
58+
59+ # Check data of a wheel file
60+ file_whl = next (
61+ (i for i in data ["files" ] if i ["filename" ] == "Django-1.10.4-py2.py3-none-any.whl" ), None
62+ )
63+ assert file_whl is not None , "wheel file not found"
64+ assert file_whl ["url" ]
65+ assert file_whl ["hashes" ] == {
66+ "sha256" : "a8e1a552205cda15023c39ecf17f7e525e96c5b0142e7879e8bd0c445351f2cc"
67+ }
68+ assert file_whl ["requires-python" ] is None
69+ assert file_whl ["data-dist-info-metadata" ] is False # todo: wrong
70+
71+ # Check data of a tar file
72+ file_tar = next ((i for i in data ["files" ] if i ["filename" ] == "Django-1.10.4.tar.gz" ), None )
73+ assert file_tar is not None , "tar file not found"
74+ assert file_tar ["url" ]
75+ assert file_tar ["hashes" ] == {
76+ "sha256" : "fff7f062e510d812badde7cfc57745b7779edb4d209b2bc5ea8d954c22305c2b"
77+ }
78+ assert file_tar ["requires-python" ] is None
79+ assert file_tar ["data-dist-info-metadata" ] is False
6780
6881
6982@pytest .mark .parallel
0 commit comments