def test_supports_caching(self):
    self.assertFalse(dataset_providers.Task('nosupports_cache', source=self.function_source, output_features=self.DEFAULT_OUTPUT_FEATURES, preprocessors=[]).supports_caching)
    self.assertFalse(dataset_providers.Task('nosupports_cache', source=self.function_source, output_features=self.DEFAULT_OUTPUT_FEATURES, preprocessors=[preprocessors.tokenize]).supports_caching)
    self.assertTrue(dataset_providers.Task('supports_cache', source=self.function_source, output_features=self.DEFAULT_OUTPUT_FEATURES, preprocessors=[preprocessors.tokenize, dataset_providers.CacheDatasetPlaceholder()]).supports_caching)
    self.assertTrue(dataset_providers.Task('supports_cache', source=self.function_source, output_features=self.DEFAULT_OUTPUT_FEATURES, preprocessors=[dataset_providers.CacheDatasetPlaceholder(required=True), preprocessors.tokenize]).supports_caching)
    self.assertTrue(dataset_providers.Task('supports_cache', source=self.function_source, output_features=self.DEFAULT_OUTPUT_FEATURES, preprocessors=[dataset_providers.CacheDatasetPlaceholder()]).supports_caching)
def test_supports_caching(self):
    self.assertFalse(dataset_providers.Task('nosupports_cache', source=self.function_source, output_features=self.DEFAULT_OUTPUT_FEATURES, preprocessors=[]).supports_caching)
    self.assertFalse(dataset_providers.Task('nosupports_cache', source=self.function_source, output_features=self.DEFAULT_OUTPUT_FEATURES, preprocessors=[preprocessors.tokenize]).supports_caching)
    self.assertTrue(dataset_providers.Task('supports_cache', source=self.function_source, output_features=self.DEFAULT_OUTPUT_FEATURES, preprocessors=[preprocessors.tokenize, dataset_providers.CacheDatasetPlaceholder()]).supports_caching)
    self.assertTrue(dataset_providers.Task('supports_cache', source=self.function_source, output_features=self.DEFAULT_OUTPUT_FEATURES, preprocessors=[dataset_providers.CacheDatasetPlaceholder(required=True), preprocessors.tokenize]).supports_caching)
    self.assertTrue(dataset_providers.Task('supports_cache', source=self.function_source, output_features=self.DEFAULT_OUTPUT_FEATURES, preprocessors=[dataset_providers.CacheDatasetPlaceholder()]).supports_caching)