Files
OpenCode 68a9071cf1 feat: reconcile local master with origin (exa/hot-platform hunters, leaks ledger, latest results)
Local branch had diverged from origin/master (sibling commits on the same base). Rewrote local history linearly on top of origin/master, folding in all local content: exa/hot-platform discovery hunters, leaks ledger, nightly sweep orchestrator, updated .gitignore and skill docs, plus the latest hunt output and vault state. Remote-only files (vault keys, channel scripts) were restored rather than dropped, so the resulting tree is a full union of both sides.
2026-08-07 12:53:47 +08:00

1 line
8.3 KiB
JSON

{"repo": "agenthatch/agenthatch", "files": {"tests/test_config_validators.py": {"b3d3f082170d8f807714972b8f0dad662da1a867": {"t": 1785746642.5959477, "n": 2525, "h": "dd0757d8ff3278b5", "c": "\"\"\"Test config validators (v0.2).\"\"\"\n\nfrom __future__ import annotations\n\nimport pytest\n\nfrom agenthatch.config.validators import (\n validate_base_url,\n validate_config_integrity,\n validate_provider_name,\n)\nfrom agenthatch.exceptions import ConfigError\n\n\nclass TestValidateProviderName:\n \"\"\"Provider name validation tests.\"\"\"\n\n def test_valid_names(self):\n validate_provider_name(\"openai\")\n validate_provider_name(\"my-llm\")\n validate_provider_name(\"custom.provider\")\n validate_provider_name(\"a1\")\n\n def test_too_short(self):\n with pytest.raises(ConfigError):\n validate_provider_name(\"a\")\n\n def test_starts_with_number(self):\n with pytest.raises(ConfigError):\n validate_provider_name(\"1provider\")\n\n def test_special_chars(self):\n with pytest.raises(ConfigError):\n validate_provider_name(\"my provider\")\n\n\nclass TestValidateBaseUrl:\n \"\"\"Base URL validation tests.\"\"\"\n\n def test_valid_urls(self):\n validate_base_url(\"https://api.openai.com/v1\")\n validate_base_url(\"http://localhost:11434/v1\")\n validate_base_url(\"https://api.deepseek.com\")\n\n def test_invalid_url(self):\n with pytest.raises(ConfigError):\n validate_base_url(\"ftp://bad.com\")\n\n def test_no_protocol(self):\n with pytest.raises(ConfigError):\n validate_base_url(\"api.openai.com\")\n\n\nclass TestValidateConfigIntegrity:\n \"\"\"Config integrity validation tests.\"\"\"\n\n def test_valid_config(self):\n config = {\n \"providers\": {\n \"default\": \"openai\",\n }\n }\n warnings = validate_config_integrity(config)\n assert len(warnings) == 0\n\n def test_missing_providers_section(self):\n with pytest.raises(ConfigError):\n validate_config_integrity({})\n\n def test_unknown_default_provider(self):\n config = {\n \"providers\": {\n \"default\": \"cohere\",\n }\n }\n warnings = validate_config_integrity(config)\n assert len(warnings) > 0\n assert \"cohere\" in warnings[0]\n\n def test_custom_provider_missing_url(self):\n config = {\n \"providers\": {\n \"default\": \"openai\",\n \"custom\": {\n \"test-llm\": {\"default_model\": \"m1\"},\n },\n }\n }\n warnings = validate_config_integrity(config)\n assert len(warnings) > 0\n assert \"base_url\" in warnings[0].lower()\n"}, "8b2b5d46511207b4eb2720c6079a6a39865bccaa": {"t": 1785766518.9257221, "n": 2525, "h": "dd0757d8ff3278b5", "c": "\"\"\"Test config validators (v0.2).\"\"\"\n\nfrom __future__ import annotations\n\nimport pytest\n\nfrom agenthatch.config.validators import (\n validate_base_url,\n validate_config_integrity,\n validate_provider_name,\n)\nfrom agenthatch.exceptions import ConfigError\n\n\nclass TestValidateProviderName:\n \"\"\"Provider name validation tests.\"\"\"\n\n def test_valid_names(self):\n validate_provider_name(\"openai\")\n validate_provider_name(\"my-llm\")\n validate_provider_name(\"custom.provider\")\n validate_provider_name(\"a1\")\n\n def test_too_short(self):\n with pytest.raises(ConfigError):\n validate_provider_name(\"a\")\n\n def test_starts_with_number(self):\n with pytest.raises(ConfigError):\n validate_provider_name(\"1provider\")\n\n def test_special_chars(self):\n with pytest.raises(ConfigError):\n validate_provider_name(\"my provider\")\n\n\nclass TestValidateBaseUrl:\n \"\"\"Base URL validation tests.\"\"\"\n\n def test_valid_urls(self):\n validate_base_url(\"https://api.openai.com/v1\")\n validate_base_url(\"http://localhost:11434/v1\")\n validate_base_url(\"https://api.deepseek.com\")\n\n def test_invalid_url(self):\n with pytest.raises(ConfigError):\n validate_base_url(\"ftp://bad.com\")\n\n def test_no_protocol(self):\n with pytest.raises(ConfigError):\n validate_base_url(\"api.openai.com\")\n\n\nclass TestValidateConfigIntegrity:\n \"\"\"Config integrity validation tests.\"\"\"\n\n def test_valid_config(self):\n config = {\n \"providers\": {\n \"default\": \"openai\",\n }\n }\n warnings = validate_config_integrity(config)\n assert len(warnings) == 0\n\n def test_missing_providers_section(self):\n with pytest.raises(ConfigError):\n validate_config_integrity({})\n\n def test_unknown_default_provider(self):\n config = {\n \"providers\": {\n \"default\": \"cohere\",\n }\n }\n warnings = validate_config_integrity(config)\n assert len(warnings) > 0\n assert \"cohere\" in warnings[0]\n\n def test_custom_provider_missing_url(self):\n config = {\n \"providers\": {\n \"default\": \"openai\",\n \"custom\": {\n \"test-llm\": {\"default_model\": \"m1\"},\n },\n }\n }\n warnings = validate_config_integrity(config)\n assert len(warnings) > 0\n assert \"base_url\" in warnings[0].lower()\n"}, "52451c7acadec89adb76b49d14de2d1ef704a797": {"t": 1786068356.7081382, "n": 2525, "h": "dd0757d8ff3278b5", "c": "\"\"\"Test config validators (v0.2).\"\"\"\n\nfrom __future__ import annotations\n\nimport pytest\n\nfrom agenthatch.config.validators import (\n validate_base_url,\n validate_config_integrity,\n validate_provider_name,\n)\nfrom agenthatch.exceptions import ConfigError\n\n\nclass TestValidateProviderName:\n \"\"\"Provider name validation tests.\"\"\"\n\n def test_valid_names(self):\n validate_provider_name(\"openai\")\n validate_provider_name(\"my-llm\")\n validate_provider_name(\"custom.provider\")\n validate_provider_name(\"a1\")\n\n def test_too_short(self):\n with pytest.raises(ConfigError):\n validate_provider_name(\"a\")\n\n def test_starts_with_number(self):\n with pytest.raises(ConfigError):\n validate_provider_name(\"1provider\")\n\n def test_special_chars(self):\n with pytest.raises(ConfigError):\n validate_provider_name(\"my provider\")\n\n\nclass TestValidateBaseUrl:\n \"\"\"Base URL validation tests.\"\"\"\n\n def test_valid_urls(self):\n validate_base_url(\"https://api.openai.com/v1\")\n validate_base_url(\"http://localhost:11434/v1\")\n validate_base_url(\"https://api.deepseek.com\")\n\n def test_invalid_url(self):\n with pytest.raises(ConfigError):\n validate_base_url(\"ftp://bad.com\")\n\n def test_no_protocol(self):\n with pytest.raises(ConfigError):\n validate_base_url(\"api.openai.com\")\n\n\nclass TestValidateConfigIntegrity:\n \"\"\"Config integrity validation tests.\"\"\"\n\n def test_valid_config(self):\n config = {\n \"providers\": {\n \"default\": \"openai\",\n }\n }\n warnings = validate_config_integrity(config)\n assert len(warnings) == 0\n\n def test_missing_providers_section(self):\n with pytest.raises(ConfigError):\n validate_config_integrity({})\n\n def test_unknown_default_provider(self):\n config = {\n \"providers\": {\n \"default\": \"cohere\",\n }\n }\n warnings = validate_config_integrity(config)\n assert len(warnings) > 0\n assert \"cohere\" in warnings[0]\n\n def test_custom_provider_missing_url(self):\n config = {\n \"providers\": {\n \"default\": \"openai\",\n \"custom\": {\n \"test-llm\": {\"default_model\": \"m1\"},\n },\n }\n }\n warnings = validate_config_integrity(config)\n assert len(warnings) > 0\n assert \"base_url\" in warnings[0].lower()\n"}}}}