Alistair Coles 056b2afbd7 FakeSwift: capture unexpected calls
Previously FakeSwift would raise a KeyError for a call that had no
matching registered response *before* capturing the call. This
prevents tests reliably asserting that only expected calls have been
made. In particular, if the code being tested handles the KeyError
gracefully then it was possible to write quite reasonable test
assertions that passed despite unexpected calls being made.

Tests in test/unit/container/test_reconciler.py seem to rely on this
behaviour, so this patch adds a capture_unexpected_calls option for
FakeSwift which defauts to True. This allows the reconciler tests to
opt out of the new stricter call capturing.

Change-Id: Idc6b6b5a2b665538e861700f5d0996fc39368f5b
2024-10-11 14:31:36 +01:00
..
2010-07-12 17:03:45 -05:00