|
|
@@ -639,23 +639,26 @@ class TestClient(object): |
|
|
|
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) |
|
|
|
# Test potentially bad timestamps (due to floating point |
|
|
|
# roundoff etc). The server will round floating point values |
|
|
|
# to the nearest int. |
|
|
|
client = nilmdb.client.Client(testurl) |
|
|
|
|
|
|
|
client.stream_create("/rounding/test", "uint16_1") |
|
|
|
with client.stream_insert_context("/rounding/test", |
|
|
|
100000000, 200000000) as ctx: |
|
|
|
ctx.insert("100000000 1\n") |
|
|
|
ctx.insert("150000000 1\n") |
|
|
|
ctx.insert("199999999 1\n") |
|
|
|
100000000, 200000000.1) as ctx: |
|
|
|
ctx.insert("100000000.1 1\n") |
|
|
|
ctx.insert("150000000.00003 1\n") |
|
|
|
ctx.insert("199999999.4 1\n") |
|
|
|
eq_(list(client.stream_intervals("/rounding/test")), |
|
|
|
[ [ 100000000, 200000000 ] ]) |
|
|
|
|
|
|
|
with assert_raises(ClientError): |
|
|
|
with client.stream_insert_context("/rounding/test", |
|
|
|
200000000, 300000000) as ctx: |
|
|
|
ctx.insert("200000000 1\n") |
|
|
|
ctx.insert("250000000 1\n") |
|
|
|
# Server will round this and give an error on finalize() |
|
|
|
ctx.insert("299999999.99 1\n") |
|
|
|
|
|
|
|
client.stream_destroy("/rounding/test") |
|
|
|