def test_move_calls_datas_move(self, mock_loads, mock_dumps): mock_core_game = Mock() mock_loads.return_value = mock_core_game mock_dumps.return_value = 'dumps return' game = Game() game.data = 'game data' game.move(current_x=1, current_y=2, new_x=3, new_y=4) assert mock_loads.call_args == (('game data',), {}) assert mock_core_game.make_move.called assert mock_core_game.make_move.call_args == (((1, 2), (3, 4)), {}) assert game.data == 'dumps return'