mirror of
https://github.com/KevinMidboe/python-gpiozero.git
synced 2025-10-29 17:50:37 +00:00
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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user