Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/svn/tests/test_loader.py
Show First 20 Lines • Show All 115 Lines • ▼ Show 20 Lines | revs = list( | ||||
loader.storage.revision_get( | loader.storage.revision_get( | ||||
[hash_to_bytes("95edacc8848369d6fb1608e887d6d2474fd5224f")] | [hash_to_bytes("95edacc8848369d6fb1608e887d6d2474fd5224f")] | ||||
) | ) | ||||
) | ) | ||||
start_revision = revs[0] | start_revision = revs[0] | ||||
assert start_revision is not None | assert start_revision is not None | ||||
loader = SvnLoader(repo_url, swh_revision=start_revision) | loader = SvnLoader(repo_url, swh_revision=start_revision) | ||||
assert loader.load() == {"status": "eventful"} | assert loader.load() == {"status": "uneventful"} | ||||
ardumont: That now actually makes sense.
Nothing should have happened initially \m/ | |||||
stats = get_stats(loader.storage) | stats = get_stats(loader.storage) | ||||
assert stats["origin_visit"] == 2 + 1 | assert stats["origin_visit"] == 2 + 1 | ||||
# ... with no change in repository, this yields the same snapshot | # ... with no change in repository, this yields the same snapshot | ||||
assert stats["snapshot"] == 1 | assert stats["snapshot"] == 1 | ||||
assert_last_visit_matches( | assert_last_visit_matches( | ||||
loader.storage, | loader.storage, | ||||
▲ Show 20 Lines • Show All 448 Lines • ▼ Show 20 Lines | assert_last_visit_matches( | ||||
snapshot=GOURMET_SNAPSHOT.id, | snapshot=GOURMET_SNAPSHOT.id, | ||||
) | ) | ||||
stats = get_stats(loader.storage) | stats = get_stats(loader.storage) | ||||
assert stats["origin"] == 2 | assert stats["origin"] == 2 | ||||
assert stats["origin_visit"] == 3 | assert stats["origin_visit"] == 3 | ||||
assert stats["snapshot"] == 1 | assert stats["snapshot"] == 1 | ||||
# second visit from the dump should be uneventful | |||||
loaderFromDump = SvnLoaderFromRemoteDump(repo_url) | |||||
assert loaderFromDump.load() == {"status": "uneventful"} | |||||
def test_loader_user_defined_svn_properties(swh_config, datadir, tmp_path): | def test_loader_user_defined_svn_properties(swh_config, datadir, tmp_path): | ||||
"""Edge cases: The repository held some user defined svn-properties with special | """Edge cases: The repository held some user defined svn-properties with special | ||||
encodings, this prevented the repository from being loaded even though we do not | encodings, this prevented the repository from being loaded even though we do not | ||||
ingest those information. | ingest those information. | ||||
""" | """ | ||||
archive_name = "httthttt" | archive_name = "httthttt" | ||||
Show All 30 Lines |
That now actually makes sense.
Nothing should have happened initially \m/