diff --git a/monkey/tests/unit_tests/monkey_island/test_config_file_parser.py b/monkey/tests/unit_tests/monkey_island/test_config_file_parser.py new file mode 100644 index 000000000..8a0bb3fff --- /dev/null +++ b/monkey/tests/unit_tests/monkey_island/test_config_file_parser.py @@ -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"