Commit 6a08675e authored by Conor Finn's avatar Conor Finn
Browse files

Fix tests failing on build servers

RE #28499
parent d3fd9f0c
......@@ -37,13 +37,7 @@ public:
static LoadILLSANSTest *createSuite() { return new LoadILLSANSTest(); }
static void destroySuite(LoadILLSANSTest *suite) { delete suite; }
void setUp() override {
ConfigService::Instance().appendDataSearchSubDir("ILL/D11/");
ConfigService::Instance().appendDataSearchSubDir("ILL/D22/");
ConfigService::Instance().appendDataSearchSubDir("ILL/D33/");
ConfigService::Instance().appendDataSearchSubDir("ILL/D16/");
ConfigService::Instance().setFacility("ILL");
}
void setUp() override { ConfigService::Instance().setFacility("ILL"); }
void tearDown() override { AnalysisDataService::Instance().clear(); }
......
......@@ -1504,7 +1504,7 @@ void ConfigServiceImpl::appendDataSearchDir(const std::string &path) {
if (!isInDataSearchList(dirPath.toString())) {
auto newSearchString = Strings::join(std::begin(m_dataSearchDirs),
std::end(m_dataSearchDirs), ";");
newSearchString.append(path);
newSearchString.append(";" + path);
setString("datasearch.directories", newSearchString);
}
}
......
# Mantid Repository : https://github.com/mantidproject/mantid
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
......@@ -109,12 +110,13 @@ class ConfigServiceTest(unittest.TestCase):
def test_appending_paths(self):
new_path_list = self._setup_test_areas()
try:
num_of_dirs = len(config.getDataSearchDirs())
config.appendDataSearchDir(str(new_path_list[0]))
updated_paths = config.getDataSearchDirs()
finally:
self._clean_up_test_areas()
self.assertEqual(4, len(updated_paths))
self.assertEqual(num_of_dirs+1, len(updated_paths))
def test_setting_log_channel_levels(self):
testhelpers.assertRaisesNothing(self, config.setLogLevel, 4, True)
......@@ -153,7 +155,7 @@ class ConfigServiceTest(unittest.TestCase):
'loading.multifile', 'loading.multifilelimit',
'maskFiles.directory',
'pythonalgorithms.refresh.allowed',
'sliceviewer.nonorthogonal'
'sliceviewer.nonorthogonal',
########## TODO should these be documented?
'curvefitting.defaultPeak', 'curvefitting.findPeaksFWHM', 'curvefitting.findPeaksTolerance', 'curvefitting.guiExclude',
......
......@@ -79,10 +79,10 @@ class IndirectCommonTests(unittest.TestCase):
self.assertRaises(ValueError, indirect_common.getEfixed, ws.name())
def test_getDefaultWorkingDirectory(self):
config['defaultsave.directory'] = os.path.expanduser('~/')
config['defaultsave.directory'] = os.path.join(os.path.expanduser('~'), "")
workdir = indirect_common.getDefaultWorkingDirectory()
self.assertEqual(os.path.expanduser('~/'), workdir,
"The working directory does not match the expected one")
self.assertEqual(os.path.join(os.path.expanduser('~'), ""), workdir,
"The working directory does not match the expected one")
def test_getDefaultWorkingDirectory_failure(self):
config['defaultsave.directory'] = ''
......
......@@ -370,8 +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["defaultsave.directory"] = default_dir
# ConfigService returns an absolute path when called.
default_dir = os.path.join(os.getcwd(), default_dir, "")
# ConfigService may do some conversion in the background.
default_dir = ConfigService["defaultsave.directory"]
output_dir = self.presenter.set_output_directory("")
ConfigService["defaultsave.directory"] = ""
......
Markdown is supported
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