Changeset View
Changeset View
Standalone View
Standalone View
swh/indexer/tests/test_origin_head.py
Show First 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | storage.origin_add( | ||||
url=origin_url, | url=origin_url, | ||||
) | ) | ||||
] | ] | ||||
) | ) | ||||
assert get_head_swhid(storage, origin_url) is None | assert get_head_swhid(storage, origin_url) is None | ||||
def test_pypi(storage): | def test_pypi(storage): | ||||
origin_url = "https://pypi.org/project/limnoria/" | origin_url = "https://old-pypi.example.org/project/limnoria/" | ||||
assert get_head_swhid(storage, origin_url) == CoreSWHID.from_string( | assert get_head_swhid(storage, origin_url) == CoreSWHID.from_string( | ||||
"swh:1:rev:83b9b6c705b125d0fe6dd86b41109dc5fa32f874" | "swh:1:rev:83b9b6c705b125d0fe6dd86b41109dc5fa32f874" | ||||
) | ) | ||||
origin_url = "https://pypi.org/project/limnoria/" | |||||
assert get_head_swhid(storage, origin_url) == CoreSWHID.from_string( | |||||
"swh:1:rel:83b9b6c705b125d0fe6dd86b41109dc5fa32f874" | |||||
) | |||||
def test_svn(storage): | def test_svn(storage): | ||||
origin_url = "http://0-512-md.googlecode.com/svn/" | origin_url = "http://0-512-md.googlecode.com/svn/" | ||||
assert get_head_swhid(storage, origin_url) == CoreSWHID.from_string( | assert get_head_swhid(storage, origin_url) == CoreSWHID.from_string( | ||||
"swh:1:rev:e43f72e12c88abece79a87b8c9ad232e1b773d18" | "swh:1:rev:e43f72e12c88abece79a87b8c9ad232e1b773d18" | ||||
) | ) |