コード例 #1
0
ファイル: test_backend.py プロジェクト: encukou/roboprojekt
def test_robot_changed_coordinates(tile):
    """
    When a robot stands on FlagTile the start coordinates change to the tile's coordinates.
    """
    robot = Robot(Direction.N, (0, 0), "tester")
    state = State({(0, 0): [tile]}, [robot])
    robot.start_coordinates = (1, 1)
    apply_tile_effects(state, 0)
    assert robot.start_coordinates == (0, 0)
コード例 #2
0
ファイル: test_backend.py プロジェクト: mpavlase/roboprojekt
def test_robot_changed_coordinates(tile):
    """
    When a robot stands on FlagTile the starting coordinates change to the tile's coordinates.
    """
    robot = Robot(None, None, None, (0, 0))
    state = State({(0, 0): [tile]}, [robot], 1)
    robot.start_coordinates = (1, 1)
    apply_tile_effects(state)
    assert robot.start_coordinates == (0, 0)
コード例 #3
0
ファイル: test_backend.py プロジェクト: encukou/roboprojekt
def test_robot_changed_start_coordinates(tile, coordinates_after):
    """
    When robot is on RepairTile with special property, he changes his start coordinates to the tile coordinates.
    On a normal RepairTile he doesn't change the start tile.
    """
    robot = Robot(Direction.N, (0, 0), "tester")
    state = State({(0, 0): [tile]}, [robot])
    robot.start_coordinates = (1, 1)
    apply_tile_effects(state, 0)
    assert robot.start_coordinates == coordinates_after