def test_move_box_into_wall(self): world = self.make_world_worker_moves_box_into_wall(2, 2) GameEngine.move(Dir.DN, world) self.assertFalse(world.push_box.called) self.assertFalse(world.move_worker.called)
def test_move_box(self): world = self.make_world_worker_moves_box(2, 2) GameEngine.move(Dir.DN, world) world.push_box.assert_called_with((2, 3), (2, 4)) world.move_worker.assert_called_with((2, 3))
def test_is_game_over_false(self): world = Mock() world.dock_pos = [(2, 1), (1, 1)] world.box_pos = [(1, 1), (2, 2)] status = GameEngine.is_game_over(world) self.assertFalse(status)
def test_move_right(self): world = self.make_world_worker_moves_on_floor(2, 2) GameEngine.move(Dir.RT, world) world.move_worker.assert_called_with((3, 2))
def test_move_down(self): world = self.make_world_worker_moves_on_floor(2, 2) GameEngine.move(Dir.DN, world) world.move_worker.assert_called_with((2, 3))