From 34399c30147ea852ac5d5a4db71d5b5e80c8ac94 Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Fri, 30 Jan 2026 18:04:31 +0000 Subject: [PATCH] Add test files: conftest, test_cli, test_parsers --- tests/conftest.py | 89 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 tests/conftest.py diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..47b752a --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,89 @@ +import pytest +from pathlib import Path +import sys + + +@pytest.fixture +def temp_project_dir(tmp_path): + pkg_json = tmp_path / "package.json" + pkg_json.write_text('''{ + "name": "test-project", + "version": "1.0.0", + "dependencies": { + "express": "^4.18.0" + }, + "devDependencies": { + "jest": "^29.0.0" + } +}''') + return tmp_path + + +@pytest.fixture +def ts_project_dir(tmp_path): + tsconfig = tmp_path / "tsconfig.json" + tsconfig.write_text('''{ + "compilerOptions": { + "target": "ES2020", + "module": "commonjs" + } +}''') + return tmp_path + + +@pytest.fixture +def python_project_dir(tmp_path): + pyproject = tmp_path / "pyproject.toml" + pyproject.write_text('''[tool.poetry] +name = "test-project" +version = "1.0.0" + +[tool.pytest.ini_options] +testpaths = ["tests"] +''') + return tmp_path + + +def test_cli_import(): + from config_auditor.cli import cli + assert cli is not None + + +def test_discovery_import(): + from config_auditor.discovery import ConfigDiscovery + assert ConfigDiscovery is not None + + +def test_parsers_import(): + from config_auditor.parsers import ParserFactory + assert ParserFactory is not None + + +def test_rules_import(): + from config_auditor.rules import RuleRegistry + assert RuleRegistry is not None + + +def test_fixes_import(): + from config_auditor.fixes import Fixer + assert Fixer is not None + + +def test_llm_import(): + from config_auditor.llm import LLMProvider + assert LLMProvider is not None + + +def test_generate_import(): + from config_auditor.generate import ConfigGenerator + assert ConfigGenerator is not None + + +def test_report_import(): + from config_auditor.report import ReportGenerator + assert ReportGenerator is not None + + +def test_utils_import(): + from config_auditor.utils import find_config_file + assert find_config_file is not None