use pathlib.Path for directories and files
This commit is contained in:
parent
110ddaf3a1
commit
8162758cec
13 changed files with 137 additions and 125 deletions
|
|
@ -39,7 +39,7 @@ def test_set_config(tmp_path: Path) -> None:
|
|||
value = "test_value"
|
||||
# config is not yet available
|
||||
tl.set_config(tmp_path, section, option, value)
|
||||
config_path = os.path.join(tmp_path, '.corrlib')
|
||||
config_path = tmp_path / '.corrlib'
|
||||
config = ConfigParser()
|
||||
config.read(config_path)
|
||||
assert config.get('core', 'test_option', fallback="not the value") == "test_value"
|
||||
|
|
@ -48,7 +48,7 @@ def test_set_config(tmp_path: Path) -> None:
|
|||
option = "test_option2"
|
||||
value = "test_value2"
|
||||
tl.set_config(tmp_path, section, option, value)
|
||||
config_path = os.path.join(tmp_path, '.corrlib')
|
||||
config_path = tmp_path / '.corrlib'
|
||||
config = ConfigParser()
|
||||
config.read(config_path)
|
||||
assert config.get('core', 'test_option2', fallback="not the value") == "test_value2"
|
||||
|
|
@ -57,7 +57,7 @@ def test_set_config(tmp_path: Path) -> None:
|
|||
option = "test_option2"
|
||||
value = "test_value3"
|
||||
tl.set_config(tmp_path, section, option, value)
|
||||
config_path = os.path.join(tmp_path, '.corrlib')
|
||||
config_path = tmp_path / '.corrlib'
|
||||
config = ConfigParser()
|
||||
config.read(config_path)
|
||||
assert config.get('core', 'test_option2', fallback="not the value") == "test_value3"
|
||||
|
|
@ -69,7 +69,7 @@ def test_get_db_file(tmp_path: Path) -> None:
|
|||
value = "test_value"
|
||||
# config is not yet available
|
||||
tl.set_config(tmp_path, section, option, value)
|
||||
assert tl.get_db_file(tmp_path) == "test_value"
|
||||
assert tl.get_db_file(tmp_path) == Path("test_value")
|
||||
|
||||
|
||||
def test_cache_enabled(tmp_path: Path) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue