mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
cfg: Fix test case failure due to incorrect path assumption
When tmpdir fixture is used, the tests run in a separate directory instead of command execution directory. Any tests that take the current directory and assume that it contains files will fail. Fix this by taking the path relative to test module instead. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
1 file changed
+2
-1
@@ -90,7 +90,8 @@ def test_read_primary_config_file():
|
||||
|
||||
def test_read_fallback_config_file():
|
||||
"""Verify that the correct fallback config file is used"""
|
||||
fallback_root = os.path.realpath('.')
|
||||
test_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
fallback_root = os.path.realpath(os.path.join(test_dir, '..', '..'))
|
||||
fallback_config_file = os.path.join(fallback_root, 'plinth.config')
|
||||
config_path, root_directory = cfg.get_fallback_config_paths()
|
||||
cfg.read(config_path, root_directory)
|
||||
|
||||
Reference in new issue
Block a user