diff --git a/tests/test_i18n.py b/tests/test_i18n.py index 197ae352..9889f798 100644 --- a/tests/test_i18n.py +++ b/tests/test_i18n.py @@ -97,26 +97,10 @@ class TestDetectLanguage: def test_canonical_config_format(self): """Test that config file reads canonical format {"env": {"STRIX_LANGUAGE": "es"}}.""" - import json - import tempfile - + # Verify the canonical format structure is valid config_data = {"env": {"STRIX_LANGUAGE": "es"}} - with tempfile.NamedTemporaryFile( - mode="w", suffix=".json", delete=False, encoding="utf-8" - ) as f: - json.dump(config_data, f) - config_path = f.name - - try: - with patch("strix.i18n.Path") as mock_path: - mock_path.home.return_value.__truediv__ = lambda self, x: Path(config_path) - mod._language = None - # The function reads from ~/.strix/cli-config.json - # We can't easily mock the Path.home() chain, so test indirectly - # by verifying the function handles the canonical format - assert isinstance(config_data["env"]["STRIX_LANGUAGE"], str) - finally: - Path(config_path).unlink(missing_ok=True) + assert isinstance(config_data["env"]["STRIX_LANGUAGE"], str) + assert config_data["env"]["STRIX_LANGUAGE"] == "es" class TestLoadLocale: