Change CompositeDevice to reject invalid identifiers

Also updated StatusBoard and StatusZero to reject duplicate identifiers
(namedtuple doesn't pick 'em up because they're passed in a dict and
thus the dups are squashed prior to the call). Added tests for all the
relevant stuff.
This commit is contained in:
Dave Jones
2017-06-25 20:44:13 +01:00
parent c9857d55ce
commit 56f2152daf
4 changed files with 43 additions and 20 deletions

View File

@@ -91,7 +91,7 @@ def test_composite_device_sequence():
assert len(device) == 2
assert device[0].pin.number == 4
assert device[1].pin.number == 5
assert device.namedtuple._fields == ('_0', '_1')
assert device.namedtuple._fields == ('device_0', 'device_1')
def test_composite_device_values():
with CompositeDevice(