summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Stephens <thomas@ustudio.com>2013-04-26 16:44:01 -0500
committerThomas Stephens <thomas@ustudio.com>2013-04-26 16:44:01 -0500
commit5b152835126685c9b6e01a46f99d50336a3e61fc (patch)
tree8a4c995a68f78f1eaa703c8799cb57c4a1338ce0
parentadc7933fd77d595fb9170fb65144e0fb1754ae02 (diff)
downloadpystatsd-5b152835126685c9b6e01a46f99d50336a3e61fc.tar.gz
Testing non-integer values for the set data type
-rw-r--r--statsd/tests.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/statsd/tests.py b/statsd/tests.py
index fb9a882..5151326 100644
--- a/statsd/tests.py
+++ b/statsd/tests.py
@@ -146,6 +146,7 @@ def test_gauge_delta():
_sock_check(sc, 4, 'foo:-1.3|g')
+@mock.patch.object(random, 'random', lambda: -1)
def test_set():
sc = _client()
sc.set('foo', 10)
@@ -154,8 +155,11 @@ def test_set():
sc.set('foo', 2.3)
_sock_check(sc, 2, 'foo:2.3|s')
+ sc.set('foo', 'bar')
+ _sock_check(sc, 3, 'foo:bar|s')
+
sc.set('foo', 2.3, 0.5)
- _sock_check(sc, 3, 'foo:2.3|s|@0.5')
+ _sock_check(sc, 4, 'foo:2.3|s|@0.5')
@mock.patch.object(random, 'random', lambda: -1)