Changeset View
Changeset View
Standalone View
Standalone View
swh/provenance/tests/test_revision_content_layer.py
Show First 20 Lines • Show All 273 Lines • ▼ Show 20 Lines | for synth_rev in synthetic_revision_content_result(syntheticfile): | ||||
for dc in synth_rev["D_C"]: | for dc in synth_rev["D_C"]: | ||||
assert ( | assert ( | ||||
rev_ts + dc["rel_ts"] | rev_ts + dc["rel_ts"] | ||||
== provenance.storage.content_get([dc["dst"]])[dc["dst"]].timestamp() | == provenance.storage.content_get([dc["dst"]])[dc["dst"]].timestamp() | ||||
), synth_rev["msg"] | ), synth_rev["msg"] | ||||
if provenance.storage.with_path(): | if provenance.storage.with_path(): | ||||
# check for location entries | # check for location entries | ||||
rows["location"] |= set(x["path"] for x in synth_rev["R_C"]) | rows["location"] |= set(x["path"].encode() for x in synth_rev["R_C"]) | ||||
rows["location"] |= set(x["path"] for x in synth_rev["D_C"]) | rows["location"] |= set(x["path"].encode() for x in synth_rev["D_C"]) | ||||
rows["location"] |= set(x["path"] for x in synth_rev["R_D"]) | rows["location"] |= set(x["path"].encode() for x in synth_rev["R_D"]) | ||||
assert rows["location"] == provenance.storage.location_get(), synth_rev[ | assert rows["location"] == provenance.storage.location_get(), synth_rev[ | ||||
"msg" | "msg" | ||||
] | ] | ||||
@pytest.mark.parametrize( | @pytest.mark.parametrize( | ||||
"repo, lower, mindepth", | "repo, lower, mindepth", | ||||
( | ( | ||||
▲ Show 20 Lines • Show All 155 Lines • Show Last 20 Lines |