From f7d507ee5cfad0240d146d2f7e5428af07158bf5 Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Sun, 22 Mar 2026 21:59:23 +0000 Subject: [PATCH] Add mockapi source files and tests --- tests/unit/test_config.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/tests/unit/test_config.py b/tests/unit/test_config.py index cc214a9..e75cd9d 100644 --- a/tests/unit/test_config.py +++ b/tests/unit/test_config.py @@ -27,12 +27,7 @@ class TestConfig: def test_load_from_dict(self): """Test creating config with dict values.""" - config = Config( - port=3000, - host="127.0.0.1", - delay=100, - seed=123, - ) + config = Config(port=3000, host="127.0.0.1", delay=100, seed=123) assert config.port == 3000 assert config.host == "127.0.0.1" assert config.delay == 100 @@ -73,9 +68,7 @@ class TestConfig: "seed": 456, } - with tempfile.NamedTemporaryFile( - mode="w", suffix=".yaml", delete=False - ) as f: + with tempfile.NamedTemporaryFile(mode="w", suffix=".yaml", delete=False) as f: yaml.dump(config_data, f) temp_path = f.name @@ -93,9 +86,7 @@ class TestConfig: """Test that environment variables override file config.""" config_data = {"port": 7000, "host": "0.0.0.0"} - with tempfile.NamedTemporaryFile( - mode="w", suffix=".yaml", delete=False - ) as f: + with tempfile.NamedTemporaryFile(mode="w", suffix=".yaml", delete=False) as f: yaml.dump(config_data, f) temp_path = f.name @@ -111,4 +102,4 @@ class TestConfig: def test_load_config_default_path(self): """Test load_config with no arguments.""" config = load_config() - assert isinstance(config, Config) \ No newline at end of file + assert isinstance(config, Config)