first http domoticz test works

This commit is contained in:
Edwin Eefting
2018-01-12 01:04:47 +01:00
parent 76be5dd8d9
commit 36415d424e
2 changed files with 4 additions and 5 deletions
+2 -3
View File
@@ -90,9 +90,8 @@ def http_expect_request(path, matches, timeout=60):
# check http results
while time.time()-start_time<timeout:
while http_requests.full():
request=http_requests.pop()
while not http_requests.empty():
request=http_requests.get()
if request.path == path:
ok=True
for match in matches.items():
+2 -2
View File
@@ -13,8 +13,8 @@ espeasy[0].device_p004(index=1, taskdevicepin1=2, plugin_004_dev=0, plugin_004_r
espeasy[0].device_p004(index=2, taskdevicepin1=2, plugin_004_dev=1, plugin_004_res=9, TDID1=1418)
#wait for request
temp1=http_expect_request("/json.html", { 'idx': 1417 }, timeout=10)
temp2=http_expect_request("/json.html", { 'idx': 1418 }, timeout=10)
temp1=http_expect_request("/json.htm", { 'idx': '1417' }, timeout=10)
temp2=http_expect_request("/json.htm", { 'idx': '1418' }, timeout=10)
if not ( float(temp1.params['svalue'])>0 and float(temp1.params['svalue'])<40 and float(temp2.params['svalue'])>0 and float(temp2.params['svalue'])<40):
raise(Exception("Wrong results"))