Changeset View
Changeset View
Standalone View
Standalone View
swh/provenance/tests/test_revision_content_layer.py
Show First 20 Lines • Show All 255 Lines • ▼ Show 20 Lines | for synth_rev in synthetic_revision_content_result(syntheticfile): | ||||
RelationType.DIR_IN_REV | RelationType.DIR_IN_REV | ||||
).items() | ).items() | ||||
for rel in rels | for rel in rels | ||||
}, synth_rev["msg"] | }, synth_rev["msg"] | ||||
# check timestamps | # check timestamps | ||||
for rd in synth_rev["R_D"]: | for rd in synth_rev["R_D"]: | ||||
assert ( | assert ( | ||||
rev_ts + rd["rel_ts"] | rev_ts + rd["rel_ts"] | ||||
== provenance.storage.directory_get([rd["dst"]])[rd["dst"]].timestamp() | == provenance.storage.directory_get([rd["dst"]])[ | ||||
rd["dst"] | |||||
].date.timestamp() | |||||
), synth_rev["msg"] | ), synth_rev["msg"] | ||||
# ... + a number of rows in the "content_in_dir" table | # ... + a number of rows in the "content_in_dir" table | ||||
# for content of the directory. | # for content of the directory. | ||||
# check for D-C entries | # check for D-C entries | ||||
rows["content_in_directory"] |= set( | rows["content_in_directory"] |= set( | ||||
(x["dst"], x["src"], maybe_path(x["path"])) for x in synth_rev["D_C"] | (x["dst"], x["src"], maybe_path(x["path"])) for x in synth_rev["D_C"] | ||||
) | ) | ||||
▲ Show 20 Lines • Show All 182 Lines • Show Last 20 Lines |