|
|
@@ -448,7 +448,9 @@ class TestClient(object): |
|
|
|
ctx.insert("\n103 1\n") |
|
|
|
|
|
|
|
ctx.insert("104 1\n") |
|
|
|
ctx.insert("105 1\n") |
|
|
|
ctx.insert("# hello\n") |
|
|
|
ctx.insert(" # hello\n") |
|
|
|
ctx.insert(" 105 1\n") |
|
|
|
ctx.finalize() |
|
|
|
|
|
|
|
ctx.insert("106 1\n") |
|
|
@@ -465,8 +467,11 @@ class TestClient(object): |
|
|
|
ctx.update_end(114) |
|
|
|
ctx.insert("113 1\n") |
|
|
|
ctx.update_end(115) |
|
|
|
ctx.insert("114 1\n") |
|
|
|
ctx.insert("114 1" + |
|
|
|
" # this is super long" * 100 + |
|
|
|
"\n") |
|
|
|
ctx.finalize() |
|
|
|
ctx.insert("# this is super long" * 100) |
|
|
|
|
|
|
|
with assert_raises(ClientError): |
|
|
|
with client.stream_insert_context("/context/test", 100, 200) as ctx: |
|
|
@@ -476,6 +481,10 @@ class TestClient(object): |
|
|
|
with client.stream_insert_context("/context/test", 200, 300) as ctx: |
|
|
|
ctx.insert("115 1\n") |
|
|
|
|
|
|
|
with assert_raises(ClientError): |
|
|
|
with client.stream_insert_context("/context/test") as ctx: |
|
|
|
ctx.insert("bogus data\n") |
|
|
|
|
|
|
|
with client.stream_insert_context("/context/test", 200, 300) as ctx: |
|
|
|
# make sure our override wasn't permanent |
|
|
|
ne_(ctx._max_data, 15) |
|
|
@@ -566,8 +575,15 @@ class TestClient(object): |
|
|
|
ctx.update_end(1350) |
|
|
|
ctx.finalize() # nothing |
|
|
|
ctx.update_start(1400) |
|
|
|
ctx.insert("# nothing!\n") |
|
|
|
ctx.update_end(1450) |
|
|
|
ctx.finalize() |
|
|
|
ctx.update_start(1500) |
|
|
|
ctx.insert("# nothing!") |
|
|
|
ctx.update_end(1550) |
|
|
|
ctx.finalize() |
|
|
|
ctx.insert("# nothing!\n" * 10) |
|
|
|
ctx.finalize() |
|
|
|
# implicit last finalize inserts [1400, 1450] |
|
|
|
|
|
|
|
# Check everything |
|
|
@@ -580,6 +596,7 @@ class TestClient(object): |
|
|
|
(1, [1100, 1100.000001]), |
|
|
|
(1, [1199, 1250]), |
|
|
|
(0, [1400, 1450]), |
|
|
|
(0, [1500, 1550]), |
|
|
|
]) |
|
|
|
|
|
|
|
# Clean up |
|
|
|