test suite fixes

This commit is contained in:
Edwin Eefting
2018-01-11 01:35:32 +01:00
parent 33e46addbb
commit 0b68e16894
3 changed files with 19 additions and 9 deletions
+3
View File
@@ -26,6 +26,7 @@ class EspEasy:
self._node.log.info("Config controller domoticz mqtt "+str(kwargs))
self._node.http_post(
twice=True, # needed for controllers and devices because of the way its implemented
page="controllers",
params="""
@@ -50,6 +51,7 @@ class EspEasy:
self._node.log.info("Config device plugin p001 "+str(kwargs))
self._node.http_post(
twice=True, # needed for controllers and devices because of the way its implemented
page="devices",
params="""
@@ -76,6 +78,7 @@ class EspEasy:
self._node.log.info("Config device plugin p004 "+str(kwargs))
self._node.http_post(
twice=True, # needed for controllers and devices because of the way its implemented
page="devices",
params="""
+9 -1
View File
@@ -134,7 +134,7 @@ class Node():
def http_post(self, page, params, data=None):
def http_post(self, page, params, data=None, twice=False):
"""http post to espeasy webinterface. (GET if data is None)"""
# transform easy copy/pastable chromium data into a dict
@@ -162,3 +162,11 @@ class Node():
data=data_dict
)
r.raise_for_status()
if twice:
r=requests.post(
self._url+page,
params=params_dict,
data=data_dict
)
r.raise_for_status()
+7 -8
View File
@@ -10,13 +10,12 @@ espeasy[0].device_p004(index=2, taskdevicepin1=2, plugin_004_dev=1, plugin_004_r
# check mqtt results
temp1=mqtt_expect_json("domoticz/in", { 'idx': 1417 }, timeout=5)
temp2=mqtt_expect_json("domoticz/in", { 'idx': 1418 }, timeout=5)
temp1=mqtt_expect_json("domoticz/in", { 'idx': 1417 }, timeout=10)
temp2=mqtt_expect_json("domoticz/in", { 'idx': 1418 }, timeout=10)
if int(temp1.svalue)>0 and int(temp1.svalue)<40:
if int(temp1.svalue)>0 and int(temp1.svalue)<40:
if float(temp1['svalue'])>0 and float(temp1['svalue'])<40 and float(temp2['svalue'])>0 and float(temp2['svalue'])<40:
#FIXME:
log.info("passed")
raise(Exception("Test failed"))
#FIXME:
log.info("passed")
else:
raise(Exception("Test failed"))