test: rewind-exclusion assertion inspects the real results key
The discovery payload exposes hits under `results`, not `matches`, so the
loop over `result_rewind.get("matches", [])` never iterated and the
invariant (the rewound row never surfaces, even via the OR-relaxed retry)
was not being checked. Assert on the anchor message id and snippet of each
returned result instead.
This commit is contained in:
@@ -931,18 +931,16 @@ class TestRewindExclusion:
|
||||
))
|
||||
assert result_compact["count"] >= 1
|
||||
|
||||
# Rewound content should NOT be discoverable. (The OR-relaxed
|
||||
# zero-result retry may surface OTHER active rows sharing a common
|
||||
# term like "content" — that's fine; the invariant is that the
|
||||
# rewound row itself never comes back.)
|
||||
# Rewound content should NOT be discoverable. The OR-relaxed zero-result
|
||||
# retry may legitimately surface OTHER active rows sharing the common term
|
||||
# "content"; the invariant is that the rewound row itself never comes back.
|
||||
result_rewind = json.loads(session_search(
|
||||
query="rewound content gamma", db=db,
|
||||
current_session_id="s_mixed",
|
||||
))
|
||||
for m in result_rewind.get("matches", []):
|
||||
snippet = (m.get("snippet") or "").lower()
|
||||
assert "rewound" not in snippet
|
||||
assert "gamma" not in snippet
|
||||
for entry in result_rewind["results"]:
|
||||
assert entry["match_message_id"] != mid2
|
||||
assert "gamma" not in (entry.get("snippet") or "").lower()
|
||||
|
||||
|
||||
class TestLegacyContinuationPlusDelegation:
|
||||
|
||||
Reference in New Issue
Block a user