Add 'yellow' as an alias of 'amber' for TrafficLights

Fixes #345
This commit is contained in:
Andrew Scheller
2016-06-10 01:46:00 +01:00
parent 145aa801cd
commit 38262a125f
2 changed files with 29 additions and 3 deletions

View File

@@ -551,6 +551,11 @@ def test_traffic_lights():
assert red_pin.state
assert not amber_pin.state
assert not green_pin.state
with TrafficLights(red=red_pin, yellow=amber_pin, green=green_pin) as board:
board.yellow.on()
assert not red_pin.state
assert amber_pin.state
assert not green_pin.state
def test_traffic_lights_bad_init():
with pytest.raises(ValueError):