Fix file_in_simpa_home test
Describe the bug There are two problems with the test_instantiate_when_file_is_in_simpa_home test in test_path_manager.py:
-
If a config in simpa_home already exists it will be used, but it's paths are compared to the generic paths defined in setUp (e.g. /workplace/data/). What should be done instead, is to hide the simpa_home_config if it exist and then create a generic simpa_home_config. When the checks are finished, the generic one is deleted and the original one restored.
-
The Simpa Home only exists when the local source code is used and not the installed package. This makes the test fail when
python -m unittestis used to run it. A workaround would be to skip this test when the simpa package is used, like this for example
pathmanager_source_file = inspect.getsourcefile(PathManager)
if "site-packages" not in pathmanager_source_file:
# run usual test
Specify a priority (low, medium, high) low
To Reproduce cd simpa_tests python -m unittest automatic_tests/test_path_manager.py