M16: isolate acceptance and harden readiness

This commit is contained in:
NuklearRabbit
2026-08-10 12:08:42 +02:00
parent 2ee8b2d82b
commit 686795a452
13 changed files with 200 additions and 41 deletions
+8
View File
@@ -305,3 +305,11 @@ def test_concurrent_returns_only_one_succeeds():
assert results.count(201) == 1
assert results.count(409) == 2
def test_return_public_refs_are_collision_resistant() -> None:
from app.services.returns import _new_inspection_ref
refs = {_new_inspection_ref() for _ in range(1000)}
assert len(refs) == 1000
assert all(ref.startswith("INSP-") and len(ref) == 15 for ref in refs)