diff --git a/server/tests/test_dedicated_server_config.py b/server/tests/test_dedicated_server_config.py new file mode 100644 index 0000000..5ba55a4 --- /dev/null +++ b/server/tests/test_dedicated_server_config.py @@ -0,0 +1,27 @@ +from pathlib import Path + +from config import Config +from dedicated_server import build_service_config + + +def test_dedicated_server_preserves_gns_rollout_fields(tmp_path: Path): + config_path = tmp_path / "commonwealth-server.json" + config = Config( + host="127.0.0.1", + port=7777, + server_name="Test", + server_description="GNS", + max_players=12, + log_verbosity="debug", + admin_port=7779, + enable_gns_transport=True, + gns_bridge_path="/opt/commonwealth/libcommonwealth_online_gns_bridge.so", + ) + + service_config = build_service_config(config, config_path) + assert service_config.host == "127.0.0.1" + assert service_config.port == 7777 + assert service_config.max_players == 12 + assert service_config.enable_gns_transport is True + assert service_config.gns_bridge_path == "/opt/commonwealth/libcommonwealth_online_gns_bridge.so" + assert service_config.bans_path == str(tmp_path / "bans.json")