Beispiel #1
0
    def test_drop_occupied_action(self):
        robot = GripperRobot(10, Heading.WEST)
        robot.hold_object = True
        game = self.default_game()
        game.grid[0][0] = True
        robot.step([False, 0, False, True], game)

        self.assertTrue(robot.hold_object)
        self.assertTrue(game.grid[0][0])
Beispiel #2
0
    def test_drop(self):
        robot = GripperRobot(10, Heading.WEST, (1, 1))
        robot.hold_object = True
        game = self.default_game()
        game.grid[1][1] = False
        robot.drop(game)

        self.assertFalse(robot.hold_object)
        self.assertTrue(game.grid[1][1])
Beispiel #3
0
    def test_drop_occupied(self):
        robot = GripperRobot(10, Heading.WEST)
        robot.hold_object = True
        game = self.default_game()
        game.grid[0][0] = True
        robot.drop(game)

        self.assertTrue(robot.hold_object)
        self.assertTrue(game.grid[0][0])