diff --git a/python_template_server/models.py b/python_template_server/models.py index 6db6e31..398f542 100644 --- a/python_template_server/models.py +++ b/python_template_server/models.py @@ -91,6 +91,7 @@ def save_to_file(self, filepath: Path) -> None: """ with filepath.open("w", encoding="utf-8") as config_file: config_file.write(self.model_dump_json(indent=2)) + config_file.write("\n") # Prometheus Metric Models diff --git a/tests/test_models.py b/tests/test_models.py index 5e23bf4..aec19aa 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -133,7 +133,7 @@ def test_save_to_file( """Test the save_to_file method.""" config_file = tmp_path / "config.json" mock_template_server_config.save_to_file(config_file) - assert config_file.read_text(encoding="utf-8") == mock_template_server_config.model_dump_json(indent=2) + assert config_file.read_text(encoding="utf-8") == mock_template_server_config.model_dump_json(indent=2) + "\n" # Prometheus Metric Models