Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/tests/migrate_extrinsic_metadata/test_pypi.py
Show First 20 Lines • Show All 171 Lines • ▼ Show 20 Lines | storage.snapshot_add( | ||||
) | ) | ||||
] | ] | ||||
) | ) | ||||
class response: | class response: | ||||
code = 200 | code = 200 | ||||
def read(self): | def read(self): | ||||
return b'{"name": "ProjectName"}' | return b'{"info": {"name": "ProjectName"}}' | ||||
mock_urlopen = mocker.patch( | mock_urlopen = mocker.patch( | ||||
"swh.storage.migrate_extrinsic_metadata.urlopen", return_value=response(), | "swh.storage.migrate_extrinsic_metadata.urlopen", return_value=response(), | ||||
) | ) | ||||
assert ( | assert ( | ||||
pypi_origin_from_filename(storage, revision_id, "ProjectName-1.0.0.tar.gz") | pypi_origin_from_filename(storage, revision_id, "ProjectName-1.0.0.tar.gz") | ||||
== origin_url | == origin_url | ||||
▲ Show 20 Lines • Show All 445 Lines • Show Last 20 Lines |