def test_timed(self): metrics = NullMetrics() @metrics.timed("my metric") @pretend.call_recorder def fn(inp): return inp result = pretend.stub() assert fn(result) is result assert fn.calls == [pretend.call(result)] with metrics.timed("my metric"): pass
def test_service_check(self): metrics = NullMetrics() metrics.service_check(pretend.stub(), pretend.stub())
def test_event(self): metrics = NullMetrics() metrics.event(pretend.stub(), pretend.stub(), pretend.stub())
def test_noop(self, method): metrics = NullMetrics() getattr(metrics, method)("my metric", pretend.stub())
def test_create_service(self): assert isinstance( NullMetrics.create_service(pretend.stub(), pretend.stub()), NullMetrics )