From 88d894cf75be99eb582e0fab300db7472fa92093 Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Thu, 5 Feb 2026 06:59:58 +0000 Subject: [PATCH] fix: resolve CI lint and test failures --- .../tests/unit/test_config.py | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 app/local-ai-commit-reviewer/tests/unit/test_config.py diff --git a/app/local-ai-commit-reviewer/tests/unit/test_config.py b/app/local-ai-commit-reviewer/tests/unit/test_config.py new file mode 100644 index 0000000..3446242 --- /dev/null +++ b/app/local-ai-commit-reviewer/tests/unit/test_config.py @@ -0,0 +1,50 @@ +from src.config import Config, ConfigLoader + + +class TestConfig: + def test_default_config(self): + config = Config() + assert config.llm.endpoint == "http://localhost:11434" + assert config.llm.model == "codellama" + assert config.review.strictness == "balanced" + assert config.hooks.enabled is True + + def test_config_from_dict(self): + data = { + "llm": { + "endpoint": "http://custom:9000", + "model": "custom-model" + }, + "review": { + "strictness": "strict" + } + } + config = Config(**data) + assert config.llm.endpoint == "http://custom:9000" + assert config.llm.model == "custom-model" + assert config.review.strictness == "strict" + + def test_language_config(self): + config = Config() + py_config = config.languages.get_language_config("python") + assert py_config is not None + assert py_config.enabled is True + + def test_strictness_profiles(self): + config = Config() + permissive = config.strictness_profiles.get_profile("permissive") + assert permissive.check_style is False + strict = config.strictness_profiles.get_profile("strict") + assert strict.check_performance is True + + +class TestConfigLoader: + def test_load_default_config(self): + loader = ConfigLoader() + config = loader.load() + assert isinstance(config, Config) + + def test_find_config_files_nonexistent(self): + loader = ConfigLoader("/nonexistent/path.yaml") + path, _global_path = loader.find_config_files() + assert path is None