def test_pickup_none(self): robot = GripperRobot(10, Heading.WEST, (1, 1)) game = self.default_game() game.grid[1][1] = False robot.pickup(game) self.assertFalse(robot.hold_object) self.assertFalse(game.grid[1][1])
def test_pickup(self): robot = GripperRobot(10, Heading.WEST) game = TilingPatternGame((1, 1), 1, RandomRobotReset(GripperRobot, 0), RandomWorldReset()) game.reset() self.assertTrue(game.grid[0][0]) robot.pickup(game) self.assertTrue(robot.hold_object) self.assertFalse(game.grid[0][0])