def test_move_all_waypoint_mode(): cmds = ["F10", "N3", "F7", "R90", "F11"] ship = solution.Ship(waypoint_mode=True) ship.waypoint = (1, 10) for cmd in cmds: ship.move(cmd) assert ship.pos == (-72, 214)
def test_move_rotate_waypoint_mode(command, waypoint, expected): ship = solution.Ship(waypoint_mode=True) ship.waypoint = waypoint ship.move(command) assert ship.waypoint == expected
def test_move_all(): cmds = ["F10", "N3", "F7", "R90", "F11"] ship = solution.Ship() for cmd in cmds: ship.move(cmd) assert ship.pos == (-8, 17)
def test_change_heading(command, heading, expected): ship = solution.Ship() ship.heading = heading ship.move(command) assert ship.heading == expected
def test_move_ship(command, pos, heading, expected): ship = solution.Ship() ship.heading = heading ship.pos = pos ship.move(command) assert ship.pos == expected
def test_ship(self): EmptyShip = s.Ship(0, 0) self.assertEquals(EmptyShip.is_worth_it(), False)