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 group_execution(*args, **kwargs):
|
||||
rv_list = []
|
||||
for member in self[:]:
|
||||
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:
|
||||
rv = super().__getattribute__(name)
|
||||
except AttributeError:
|
||||
|
@ -6,7 +6,6 @@ from simulation.rooms import house
|
||||
import sys
|
||||
from tests.all import test_smarthome
|
||||
|
||||
# TODO: Reimplement failed test(s)
|
||||
# TODO: Reimplement existing test
|
||||
# TODO: Extend tests in simulation
|
||||
# - Test: Check of warning messages for battery and overtemperature
|
||||
@ -35,8 +34,13 @@ if __name__ == "__main__":
|
||||
h = house(mc, pd)
|
||||
for name in h.getmembers():
|
||||
d = h.getobjbyname(name)
|
||||
for c in d.capabilities():
|
||||
COMMANDS.append(name + '.' + c)
|
||||
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():
|
||||
COMMANDS.append(name + '.' + c)
|
||||
#
|
||||
ts = test_smarthome(h, mc)
|
||||
for name in ts.getmembers():
|
||||
|
Loading…
x
Reference in New Issue
Block a user