Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/package/tests/test_gnu.py
Show First 20 Lines • Show All 125 Lines • ▼ Show 20 Lines | 'releases/0.1.0': { | ||||
'target': '44183488c0774ce3c957fa19ba695cf18a4a42b3', | 'target': '44183488c0774ce3c957fa19ba695cf18a4a42b3', | ||||
}, | }, | ||||
} | } | ||||
# hash is different then before as we changed the snapshot | # hash is different then before as we changed the snapshot | ||||
# gnu used to use `release/` (singular) instead of plural | # gnu used to use `release/` (singular) instead of plural | ||||
_expected_new_snapshot_first_visit_id = 'c419397fd912039825ebdbea378bc6283f006bf5' # noqa | _expected_new_snapshot_first_visit_id = 'c419397fd912039825ebdbea378bc6283f006bf5' # noqa | ||||
# def test_release_artifact_not_found(requests_mock): | |||||
# package = '8sync' | def test_release_artifact_not_found(requests_mock): | ||||
# package_url = 'https://ftp.gnu.org/gnu/8sync/' | package = '8sync' | ||||
# tarballs = [{ | package_url = 'https://ftp.gnu.org/gnu/8sync/' | ||||
# 'date': '944729610', | tarballs = [{ | ||||
# 'archive': 'https://ftp.gnu.org/gnu/8sync/8sync-0.1.0.tar.gz', | 'date': '944729610', | ||||
# }] | 'archive': 'https://ftp.gnu.org/gnu/8sync/8sync-0.1.0.tar.gz', | ||||
}] | |||||
# loader = GNULoader(package, package_url, tarballs) | |||||
# requests_mock.get(re.compile('https://'), status_code=404) | loader = GNULoader(package, package_url, tarballs) | ||||
requests_mock.get(re.compile('https://'), status_code=404) | |||||
# assert actual_load_status == {'status': 'uneventful'} | |||||
# stats = loader.storage.stat_counters() | actual_load_status = loader.load() | ||||
# assert { | assert actual_load_status == {'status': 'uneventful'} | ||||
# 'content': 0, | stats = loader.storage.stat_counters() | ||||
# 'directory': 0, | |||||
# 'origin': 1, | assert { | ||||
# 'origin_visit': 1, | 'content': 0, | ||||
# 'person': 0, | 'directory': 0, | ||||
# 'release': 0, | 'origin': 1, | ||||
# 'revision': 0, | 'origin_visit': 1, | ||||
# 'skipped_content': 0, | 'person': 0, | ||||
# 'snapshot': 0, | 'release': 0, | ||||
# } == stats | 'revision': 0, | ||||
'skipped_content': 0, | |||||
'snapshot': 0, | |||||
} == stats | |||||
def test_release_artifact_no_prior_visit(requests_mock): | def test_release_artifact_no_prior_visit(requests_mock): | ||||
"""With no prior visit, load a pypi project ends up with 1 snapshot | """With no prior visit, load a pypi project ends up with 1 snapshot | ||||
""" | """ | ||||
assert 'SWH_CONFIG_FILENAME' in os.environ # cf. tox.ini | assert 'SWH_CONFIG_FILENAME' in os.environ # cf. tox.ini | ||||
package = '8sync' | package = '8sync' | ||||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |