def _mock_and_assert_cached_source(self, task_name, buffer_size):
    cached_task = dataset_providers.get_mixture_or_task(task_name)
    cached_task._get_cached_source = mock.MagicMock(side_effect=cached_task._get_cached_source)
    _ = cached_task.get_dataset(None, 'train', use_cached=True)
    cached_task._get_cached_source.assert_called_once_with('train', buffer_size)
def _mock_and_assert_cached_source(self, task_name, buffer_size):
    cached_task = dataset_providers.get_mixture_or_task(task_name)
    cached_task._get_cached_source = mock.MagicMock(side_effect=cached_task._get_cached_source)
    _ = cached_task.get_dataset(None, 'train', use_cached=True)
    cached_task._get_cached_source.assert_called_once_with('train', buffer_size)