generalConfig, config: use pathlib

- switch to pathlib
- represent multiple confdirs as list of Paths internally, not string
  with pathsep

Change-Id: I1418e561641e27cd904af0762be056cd66ee1919
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/34464
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Alexander Zaft <a.zaft@fz-juelich.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
This commit is contained in:
Alexander Zaft
2024-08-26 14:50:58 +02:00
committed by Markus Zolliker
parent fe0aa3d7d5
commit 13db0d6bc6
7 changed files with 63 additions and 54 deletions

View File

@ -64,7 +64,7 @@ def direc(tmp_path_factory):
ff.touch()
fff.touch()
pyfile.write_text(PY_FILE)
generalConfig.testinit(confdir=f'{a}:{b}', piddir=str(d))
generalConfig.testinit(confdir=[a, b], piddir=d)
return d
@ -81,7 +81,7 @@ files = [('config', 'a/config_cfg.py'),
@pytest.mark.parametrize('file, res', files)
def test_to_cfg_path(log, direc, file, res):
assert to_config_path(file, log).endswith(res)
assert str(to_config_path(file, log)).endswith(res)
def test_cfg_not_existing(direc, log):
@ -132,7 +132,7 @@ def do_asserts(ret):
def test_process_file(direc, log):
ret = process_file(str(direc / 'a' / 'pyfile_cfg.py'), log)
ret = process_file(direc / 'a' / 'pyfile_cfg.py', log)
do_asserts(ret)