Exemplo n.º 1
0
def test_rotate_cards(card, new_direction):
    """
    Give mock robot the RotationCard and check if he's heading to the expected direction.
    """
    robot = Robot(Direction.N, None, None, None)
    robot.program = [card]
    state = get_start_state("maps/test_3.json")
    robot.apply_card_effect(state)
    assert robot.direction == new_direction
Exemplo n.º 2
0
def test_move_cards(card, new_coordinates):
    """
    Give mock robot the MovementCard and check if he moved to the expected coordinates.
    """
    robot = Robot(Direction.N, None, None, (5, 5))
    robot.program = [card]
    state = get_start_state("maps/test_3.json")
    robot.apply_card_effect(state)
    assert robot.coordinates == new_coordinates