def test__get_cached_datasets(self, _list_cached_datasets_mock): openml.config.set_cache_directory(self.static_cache_dir) _list_cached_datasets_mock.return_value = [-1, 2] datasets = _get_cached_datasets() self.assertIsInstance(datasets, dict) self.assertEqual(len(datasets), 2) self.assertIsInstance(list(datasets.values())[0], OpenMLDataset)
def test__get_cached_datasets(self, _list_cached_datasets_mock): openml.config.cache_directory = self.static_cache_dir _list_cached_datasets_mock.return_value = [-1, 2] datasets = _get_cached_datasets() self.assertIsInstance(datasets, dict) self.assertEqual(len(datasets), 2) self.assertIsInstance(list(datasets.values())[0], OpenMLDataset)
def test__get_cached_datasets(self): workdir = os.path.dirname(os.path.abspath(__file__)) workdir = os.path.join(workdir, "files") openml.config.set_cache_directory(cachedir=workdir, privatedir=workdir) datasets = _get_cached_datasets() self.assertIsInstance(datasets, dict) self.assertEqual(len(datasets), 2) self.assertIsInstance(list(datasets.values())[0], OpenMLDataset)