|
|
@@ -639,3 +639,24 @@ class TestClient(object): |
|
|
|
# Clean up |
|
|
|
c.stream_destroy("/persist/test") |
|
|
|
eq_(connections(), (1, 6)) |
|
|
|
|
|
|
|
def test_client_13_timestamp_rounding(self): |
|
|
|
raise SkipTest("doesn't work right") |
|
|
|
|
|
|
|
# Test potentially bad timestamps (due to floating point roundoff etc) |
|
|
|
client = nilmdb.client.Client(testurl) |
|
|
|
|
|
|
|
client.stream_create("/rounding/test", "uint16_1") |
|
|
|
with client.stream_insert_context("/rounding/test", 100, 200) as ctx: |
|
|
|
ctx.insert("100.000000 1\n") |
|
|
|
ctx.insert("150.000000 1\n") |
|
|
|
ctx.insert("199.999999 1\n") |
|
|
|
|
|
|
|
with assert_raises(ClientError): |
|
|
|
with client.stream_insert_context("/rounding/test", 200, 300) as ctx: |
|
|
|
ctx.insert("200.000000 1\n") |
|
|
|
ctx.insert("250.000000 1\n") |
|
|
|
ctx.insert("299.99999999 1\n") |
|
|
|
|
|
|
|
client.stream_destroy("/rounding/test") |
|
|
|
client.close() |