|
|
@@ -186,8 +186,7 @@ class TestClient(object): |
|
|
|
datetime_tz.localtz_set("America/New_York") |
|
|
|
|
|
|
|
testfile = "tests/data/prep-20120323T1000" |
|
|
|
start = datetime_tz.datetime_tz.smartparse("20120323T1000") |
|
|
|
start = start.totimestamp() |
|
|
|
start = nilmdb.utils.time.parse_time("20120323T1000") |
|
|
|
rate = 120 |
|
|
|
|
|
|
|
# First try a nonexistent path |
|
|
@@ -301,13 +300,11 @@ class TestClient(object): |
|
|
|
client = nilmdb.client.Client(url = testurl) |
|
|
|
|
|
|
|
# Trigger a client error in generator |
|
|
|
start = datetime_tz.datetime_tz.smartparse("20120323T2000") |
|
|
|
end = datetime_tz.datetime_tz.smartparse("20120323T1000") |
|
|
|
start = nilmdb.utils.time.parse_time("20120323T2000") |
|
|
|
end = nilmdb.utils.time.parse_time("20120323T1000") |
|
|
|
for function in [ client.stream_intervals, client.stream_extract ]: |
|
|
|
with assert_raises(ClientError) as e: |
|
|
|
function("/newton/prep", |
|
|
|
start.totimestamp(), |
|
|
|
end.totimestamp()).next() |
|
|
|
function("/newton/prep", start, end).next() |
|
|
|
in_("400 Bad Request", str(e.exception)) |
|
|
|
in_("start must precede end", str(e.exception)) |
|
|
|
|
|
|
|