Commit 8319c0b6 authored by Conor Finn's avatar Conor Finn
Browse files

Fix tests to account for absolute paths

Config service now converts to an absolute path when storing values.
Tests needed some changes to account for this.

RE #28499
parent e05f79b6
......@@ -79,9 +79,9 @@ class IndirectCommonTests(unittest.TestCase):
self.assertRaises(ValueError, indirect_common.getEfixed,
def test_getDefaultWorkingDirectory(self):
config[''] = os.path.expanduser('~')
config[''] = os.path.expanduser('~/')
workdir = indirect_common.getDefaultWorkingDirectory()
self.assertEqual(os.path.expanduser('~'), workdir,
self.assertEqual(os.path.expanduser('~/'), workdir,
"The working directory does not match the expected one")
def test_getDefaultWorkingDirectory_failure(self):
......@@ -370,6 +370,8 @@ class AddRunsDefaultSettingsTest(unittest.TestCase):
def test_that_if_output_directory_is_empty_default_save_directory_is_used_instead(self):
default_dir = os.path.join("default", "save", "directory")
ConfigService[""] = default_dir
# ConfigService returns an absolute path when called.
default_dir = os.path.join(os.getcwd(), default_dir, "")
output_dir = self.presenter.set_output_directory("")
ConfigService[""] = ""
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment