swift/test/unit
Matthew Oliver 00bfc425ce Add FakeStatsdClient to unit tests
Currently we simply mock calls in the FakeLogger for calls statsd calls,
and there are also some helper methods for counting and collating
metrics that were called. This Fakelogger is overloaded and doesn't
simulate the real world.
In real life we use a Statsdclient that is attached to the logger.

We've been in the situation where unit tests pass but the statsd client
stacktraces because we don't actually fake the statsdclient based off
the real one and let it's use its internal logic.

This patch creates a new FakeStatsdClient that is based off the real
one, this can then be used (like the real statsd client) and attached to
the FakeLogger.
There is quite a bit of churn in tests to make this work, because we now
have to looking into the fake statsd client to check the faked calls
made.
The FakeStatsdClient does everything the real one does, except overrides
the _send method and socket creation so no actual statsd metrics are
emitted.

Change-Id: I9cdf395e85ab559c2b67b0617f898ad2d6a870d4
2023-08-07 10:10:45 +01:00
..
account Add FakeStatsdClient to unit tests 2023-08-07 10:10:45 +01:00
cli Properly format meta and sysmeta in db info cli tools 2023-07-03 17:49:44 +00:00
common Add FakeStatsdClient to unit tests 2023-08-07 10:10:45 +01:00
container Add FakeStatsdClient to unit tests 2023-08-07 10:10:45 +01:00
obj Add FakeStatsdClient to unit tests 2023-08-07 10:10:45 +01:00
proxy Add FakeStatsdClient to unit tests 2023-08-07 10:10:45 +01:00
test_locale py3: port the test of locale 2019-06-19 09:54:14 -07:00
__init__.py proxy: remove client_chunk_size and skip_bytes from GetOrHeadHandler 2023-07-24 09:15:12 -05:00
helpers.py Unit test for keepalive timeout 2023-05-10 09:01:41 -07:00