Added tests for refactored config file parser

This commit is contained in:
VakarisZ 2021-05-20 13:35:00 +03:00
parent 8c210fc21f
commit 9f469a8ec0
1 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,16 @@
from monkey_island import config_file_parser
def test_load_server_config_from_file(test_server_config):
config = config_file_parser.load_server_config_from_file(test_server_config)
assert config["data_dir"] == "~/.monkey_island"
assert config["log_level"] == "NOTICE"
def test_load_server_config_from_file_default_path(monkeypatch, test_server_config):
monkeypatch.setattr(config_file_parser, "DEFAULT_SERVER_CONFIG_PATH", test_server_config)
config = config_file_parser.load_server_config_from_file("")
assert config["data_dir"] == "~/.monkey_island"
assert config["log_level"] == "NOTICE"