summaryrefslogtreecommitdiff
path: root/statsd/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'statsd/tests.py')
-rw-r--r--statsd/tests.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/statsd/tests.py b/statsd/tests.py
index 2ffd6b3..4080a9c 100644
--- a/statsd/tests.py
+++ b/statsd/tests.py
@@ -317,6 +317,22 @@ def test_timer_object_rate():
_timer_check(sc, 1, 'foo', 'ms@0.5')
+def test_timer_object_no_send_twice():
+ sc = _client()
+
+ t = sc.timer('foo').start()
+ t.stop()
+
+ with assert_raises(RuntimeError):
+ t.send()
+
+
+def test_timer_object_stop_without_start():
+ sc = _client()
+ with assert_raises(RuntimeError):
+ sc.timer('foo').stop()
+
+
def test_pipeline():
sc = _client()
pipe = sc.pipeline()