test(assets): move M3 mismatch docstrings onto their assertion messages

Comment-gate walk (M3): the docstrings on the two mismatch tests stated what
each test is evidence for. Under the gate's test rubric there is no keep for
tests — that claim belongs on the assertion it backs, where it surfaces on a
red build instead of only to someone already reading the source.

The metadata-swap test's docstring also claimed the row "stays a candidate
for the next enrichment pass"; dropped rather than moved, since this test
never exercises a retry and so is not evidence it provides.
This commit is contained in:
Simon Pinfold
2026-08-27 18:57:17 -07:00
parent 04e5796517
commit 18b6fd53aa

View File

@@ -87,7 +87,10 @@ def test_enrichment_discards_metadata_read_from_a_different_file_than_the_hash(
assert enriched is False
session.expire_all()
assert session.get(AssetContent, content.id).hash is None
assert session.get(Asset, record.id).system_metadata is None
assert session.get(Asset, record.id).system_metadata is None, (
"a mismatched hash observation must discard already-computed metadata too, "
"not just the hash"
)
def test_enrichment_discards_result_when_only_the_hashed_mtime_disagrees(
@@ -115,7 +118,10 @@ def test_enrichment_discards_result_when_only_the_hashed_mtime_disagrees(
assert enriched is False
session.expire_all()
assert session.get(AssetContent, content.id).hash is None
assert session.get(Asset, record.id).system_metadata is None
assert session.get(Asset, record.id).system_metadata is None, (
"size matching alone is not proof the file is unchanged; an mtime "
"disagreement alone must also discard the result"
)
def test_enrichment_lands_metadata_and_hash_from_one_stable_observation(