mirror of
https://github.com/enpaul/keyosk.git
synced 2025-09-18 21:51:57 +00:00
Add database test fixtures
Fix test condition in config tests for possible false pass
This commit is contained in:
@@ -48,10 +48,11 @@ def test_settings():
|
||||
|
||||
def test_filepath(tmp_path):
|
||||
tmp_file = Path(tmp_path, "conf.toml")
|
||||
os.environ[constants.ENV_CONFIG_PATH] = str(tmp_file)
|
||||
with tmp_file.open("w+") as outfile:
|
||||
toml.dump(DEMO_CONFIG, outfile)
|
||||
|
||||
assert config.load(tmp_file) == config.ConfigSerializer().load(DEMO_CONFIG)
|
||||
os.environ[constants.ENV_CONFIG_PATH] = str(tmp_file)
|
||||
assert config.load() == config.ConfigSerializer().load(DEMO_CONFIG)
|
||||
tmp_file.unlink()
|
||||
assert config.load(tmp_file) == config.KeyoskConfig()
|
||||
|
Reference in New Issue
Block a user