Fixed faild grouped device testcases
This commit is contained in:
parent
57353c18a1
commit
f61b8ca92a
@ -79,9 +79,15 @@ class group(object):
|
|||||||
|
|
||||||
def __getattribute__(self, name):
|
def __getattribute__(self, name):
|
||||||
def group_execution(*args, **kwargs):
|
def group_execution(*args, **kwargs):
|
||||||
|
rv_list = []
|
||||||
for member in self[:]:
|
for member in self[:]:
|
||||||
m = getattr(member, name)
|
m = getattr(member, name)
|
||||||
m(*args, **kwargs)
|
rv_list.append(m(*args, **kwargs))
|
||||||
|
rv = rv_list[0]
|
||||||
|
for other in rv_list[1:]:
|
||||||
|
if other != rv:
|
||||||
|
return None # Hopefully None was not expected ;-)
|
||||||
|
return rv # If all return values are identical
|
||||||
try:
|
try:
|
||||||
rv = super().__getattribute__(name)
|
rv = super().__getattribute__(name)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
|
@ -6,7 +6,6 @@ from simulation.rooms import house
|
|||||||
import sys
|
import sys
|
||||||
from tests.all import test_smarthome
|
from tests.all import test_smarthome
|
||||||
|
|
||||||
# TODO: Reimplement failed test(s)
|
|
||||||
# TODO: Reimplement existing test
|
# TODO: Reimplement existing test
|
||||||
# TODO: Extend tests in simulation
|
# TODO: Extend tests in simulation
|
||||||
# - Test: Check of warning messages for battery and overtemperature
|
# - Test: Check of warning messages for battery and overtemperature
|
||||||
@ -35,6 +34,11 @@ if __name__ == "__main__":
|
|||||||
h = house(mc, pd)
|
h = house(mc, pd)
|
||||||
for name in h.getmembers():
|
for name in h.getmembers():
|
||||||
d = h.getobjbyname(name)
|
d = h.getobjbyname(name)
|
||||||
|
if d.capabilities() is None:
|
||||||
|
print("\n\n" + 2*"**********\n" + "\n" + name + "\n\n" + 2*"**********\n" + "\n\n")
|
||||||
|
print(type(d))
|
||||||
|
sys.exit(2)
|
||||||
|
else:
|
||||||
for c in d.capabilities():
|
for c in d.capabilities():
|
||||||
COMMANDS.append(name + '.' + c)
|
COMMANDS.append(name + '.' + c)
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user