1
0
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:
2020-02-23 00:55:00 -05:00
parent 0088561fea
commit e475fd4971
2 changed files with 40 additions and 1 deletions

View File

@@ -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()