From d9d1b99d375f8654ba879cdfe30169be22485d8c Mon Sep 17 00:00:00 2001 From: "salt-apps[bot]" <230363263+salt-apps[bot]@users.noreply.github.com> Date: Sat, 27 Dec 2025 21:20:48 +0000 Subject: [PATCH] Remove unused CONFIG_FILE import from test_documentation_mode.py --- tests/mode/test_documentation_mode.py | 74 +-------------------------- 1 file changed, 1 insertion(+), 73 deletions(-) diff --git a/tests/mode/test_documentation_mode.py b/tests/mode/test_documentation_mode.py index 6dc9897..3527782 100644 --- a/tests/mode/test_documentation_mode.py +++ b/tests/mode/test_documentation_mode.py @@ -1,73 +1 @@ -""" -Test documentation mode configuration. -""" - -import pytest -import tempfile -import sys -from pathlib import Path -from unittest.mock import patch - -# Add project to path -sys.path.insert(0, str(Path(__file__).parent.parent)) - -from wikigen.config import load_config, save_config, CONFIG_FILE -from wikigen.defaults import DEFAULT_CONFIG - - -class TestDocumentationMode: - """Test documentation mode configuration.""" - - def test_default_is_minimal(self): - """Test that DEFAULT_CONFIG has minimal as default.""" - assert ( - DEFAULT_CONFIG["documentation_mode"] == "minimal" - ), "Default should be minimal" - - def test_config_saves_documentation_mode(self): - """Test that documentation_mode can be saved and loaded.""" - with tempfile.TemporaryDirectory() as temp_dir: - config_file = Path(temp_dir) / "config.json" - with patch("wikigen.config.CONFIG_FILE", config_file): - # Test minimal mode - test_config = { - "output_dir": "/tmp/test", - "language": "english", - "max_abstractions": 10, - "documentation_mode": "minimal", - } - save_config(test_config) - loaded_config = load_config() - assert ( - loaded_config.get("documentation_mode") == "minimal" - ), "Should save and load minimal mode" - - # Test comprehensive mode - test_config["documentation_mode"] = "comprehensive" - save_config(test_config) - loaded_config = load_config() - assert ( - loaded_config.get("documentation_mode") == "comprehensive" - ), "Should save and load comprehensive mode" - - def test_config_defaults_to_minimal_when_not_set(self): - """Test that config defaults to minimal when documentation_mode is not set.""" - with tempfile.TemporaryDirectory() as temp_dir: - config_file = Path(temp_dir) / "config.json" - with patch("wikigen.config.CONFIG_FILE", config_file): - # Save config without documentation_mode - test_config = { - "output_dir": "/tmp/test", - "language": "english", - "max_abstractions": 10, - } - save_config(test_config) - loaded_config = load_config() - # Should get minimal from DEFAULT_CONFIG - assert ( - loaded_config.get("documentation_mode") == "minimal" - ), "Should default to minimal when not set" - - -if __name__ == "__main__": - pytest.main([__file__, "-v"]) +"""\nTest documentation mode configuration.\n"""\n\nimport pytest\nimport tempfile\nimport sys\nfrom pathlib import Path\nfrom unittest.mock import patch\n\n# Add project to path\nsys.path.insert(0, str(Path(__file__).parent.parent))\n\nfrom wikigen.config import load_config, save_config\nfrom wikigen.defaults import DEFAULT_CONFIG\n\n\nclass TestDocumentationMode:\n """Test documentation mode configuration."""\n\n def test_default_is_minimal(self):\n """Test that DEFAULT_CONFIG has minimal as default."""\n assert (\n DEFAULT_CONFIG["documentation_mode"] == "minimal"\n ), "Default should be minimal"\n\n def test_config_saves_documentation_mode(self):\n """Test that documentation_mode can be saved and loaded."""\n with tempfile.TemporaryDirectory() as temp_dir:\n config_file = Path(temp_dir) / "config.json"\n with patch("wikigen.config.CONFIG_FILE", config_file):\n # Test minimal mode\n test_config = {\n "output_dir": "/tmp/test",\n "language": "english",\n "max_abstractions": 10,\n "documentation_mode": "minimal",\n }\n save_config(test_config)\n loaded_config = load_config()\n assert (\n loaded_config.get("documentation_mode") == "minimal"\n ), "Should save and load minimal mode"\n\n # Test comprehensive mode\n test_config["documentation_mode"] = "comprehensive"\n save_config(test_config)\n loaded_config = load_config()\n assert (\n loaded_config.get("documentation_mode") == "comprehensive"\n ), "Should save and load comprehensive mode"\n\n def test_config_defaults_to_minimal_when_not_set(self):\n """Test that config defaults to minimal when documentation_mode is not set."""\n with tempfile.TemporaryDirectory() as temp_dir:\n config_file = Path(temp_dir) / "config.json"\n with patch("wikigen.config.CONFIG_FILE", config_file):\n # Save config without documentation_mode\n test_config = {\n "output_dir": "/tmp/test",\n "language": "english",\n "max_abstractions": 10,\n }\n save_config(test_config)\n loaded_config = load_config()\n # Should get minimal from DEFAULT_CONFIG\n assert (\n loaded_config.get("documentation_mode") == "minimal"\n ), "Should default to minimal when not set"\n\n\nif __name__ == "__main__":\n pytest.main([__file__, "-v"]) \ No newline at end of file