mirror of
https://github.com/dtomlinson91/panaetius.git
synced 2025-12-22 04:55:44 +00:00
adding initial tests
This commit is contained in:
36
tests/test_config.py
Normal file
36
tests/test_config.py
Normal file
@@ -0,0 +1,36 @@
|
||||
import pathlib
|
||||
|
||||
import toml
|
||||
|
||||
import panaetius
|
||||
|
||||
|
||||
def test_default_config_path_set(header):
|
||||
# act
|
||||
config = panaetius.Config(header)
|
||||
|
||||
# assert
|
||||
assert str(config.config_path) == str(pathlib.Path.home() / ".config")
|
||||
|
||||
|
||||
def test_user_config_path_set(header, datadir):
|
||||
# arrange
|
||||
config_path = str(datadir / "without_logging")
|
||||
|
||||
# act
|
||||
config = panaetius.Config(header, config_path)
|
||||
|
||||
# assert
|
||||
assert str(config.config_path) == config_path
|
||||
|
||||
|
||||
def test_config_file_exists(header, datadir):
|
||||
# arrange
|
||||
config_path = str(datadir / "without_logging")
|
||||
|
||||
# act
|
||||
config = panaetius.Config(header, config_path)
|
||||
config_contents = config.config
|
||||
|
||||
# assert
|
||||
assert config._missing_config == False
|
||||
Reference in New Issue
Block a user