def test_traffic_light_cycle():
    light = TrafficLight()
    light.cycle()
    assert_equals('green', light.state)
    light.cycle()
    assert_equals('yellow', light.state)
    light.cycle()
    assert_equals('red', light.state)
Example #2
0
def test_traffic_light_cycle():
    light = TrafficLight()
    light.cycle()
    assert_equals('proceed', light.state)
    light.cycle()
    assert_equals('caution', light.state)
    light.cycle()
    assert_equals('stop', light.state)
def test_traffic_light_cycle():
    light = TrafficLight()
    light.cycle()
    assert_equals("proceed", light.state)
    light.cycle()
    assert_equals("caution", light.state)
    light.cycle()
    assert_equals("stop", light.state)
def test_traffic_light_initial():
    light = TrafficLight()
    assert_equals('red', light.state)
def test_traffic_light_cycle():
    light = TrafficLight()
    light.cycle()
    assert_equals(1, light.count)