Mux checks#244
Conversation
|
Test is failing due to using the calculated pins, rather than the supplied pin_list def test_jig_driver_with_unknown_pins():
handler1 = AddressHandler(("x0",))
handler2 = AddressHandler(("x2",))
handler3 = AddressHandler(("x1",))
class Mux(VirtualMux):
pin_list = ("x0", "x1") # "x1" isn't in either handler
map_list = ("sig1", "x1")
class Group(MuxGroup):
def __init__(self):
self.mux = Mux()
# This is O.K., because all the pins are included
JigDriver(Group, [handler1, handler2, handler3])
# ^ test is failing here due to VirtualMux._validate, since self._pin_set is incorrect
with pytest.raises(ValueError):
# This should raise, because no handler implements "x1"
JigDriver(Group, [handler1, handler2])expected output for mux pins After switching back to main it looks like this test passes, but never produced a useable mux. There isn't a great way to type this. Maybe we should enforce Sequence[tuple[str,...]] |
|
Having another look at this, I'm not sure whether we want to enforce explicitly including the pin_list or not. I think it is better to require both since with larger muxes it can be quite easy to stuff up the pins. |
Remove requirement to have both pin_list and pin_map which had issues in the new switching module if pins were missing from the list.
Add check that pins are unique across muxes.