mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-11 09:04:54 +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:
parent
c8eb5bb3ca
commit
83337e4786
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user