예제 #1
0
def test_set_states_west_to_north():
    car = Car(5, 5, '<')
    assert car.orientation == Car.Orientation.WEST
    assert car.count == 0
    assert car.state == 'W0'
    car.state = 'N1'
    assert car.orientation == Car.Orientation.NORTH
    assert car.count == 1
예제 #2
0
def test_set_states_east_to_south():
    car = Car(5, 5, '>')
    assert car.orientation == Car.Orientation.EAST
    assert car.count == 0
    assert car.state == 'E0'
    car.state = 'S1'
    assert car.orientation == Car.Orientation.SOUTH
    assert car.count == 1
예제 #3
0
def test_set_states_south_to_west():
    car = Car(5, 5, 'v')
    assert car.orientation == Car.Orientation.SOUTH
    assert car.count == 0
    assert car.state == 'S0'
    car.state = 'W1'
    assert car.orientation == Car.Orientation.WEST
    assert car.count == 1
예제 #4
0
def test_set_states_north_to_west():
    car = Car(5, 5, '^')
    assert car.orientation == Car.Orientation.NORTH
    assert car.count == 0
    assert car.state == 'N0'
    car.state = 'W1'
    assert car.orientation == Car.Orientation.WEST
    assert car.count == 1
    assert car.state == 'W1'