Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add unit test
  • Loading branch information
mfeurer committed Apr 14, 2021
commit 192b827d9017615e85236c507b27c4e619178997
10 changes: 10 additions & 0 deletions tests/test_openml/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ def test_non_writable_home(self, log_handler_mock, warnings_mock, expanduser_moc
self.assertEqual(log_handler_mock.call_count, 1)
self.assertFalse(log_handler_mock.call_args_list[0][1]["create_file_handler"])

@unittest.mock.patch("os.path.expanduser")
def test_XDG_directories_do_not_exist(self, expanduser_mock):
with tempfile.TemporaryDirectory(dir=self.workdir) as td:

def side_effect(path_):
return os.path.join(td, str(path_).replace("~/", ""))

expanduser_mock.side_effect = side_effect
openml.config._setup()

def test_get_config_as_dict(self):
""" Checks if the current configuration is returned accurately as a dict. """
config = openml.config.get_config_as_dict()
Expand Down