Browse Source

Partial test for rounding issues

tags/nilmdb-1.4.0
Jim Paris 11 years ago
parent
commit
c7a712d8d8
1 changed files with 21 additions and 0 deletions
  1. +21
    -0
      tests/test_client.py

+ 21
- 0
tests/test_client.py View File

@@ -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()

Loading…
Cancel
Save