Files
crewAI/tests/cli/test_constants.py
Devin AI 2a48e24d98 Address CI failures and code review feedback
- Remove unused pytest imports from test files (fixes lint errors)
- Fix CodeQL security alert by using exact URL validation instead of substring check
- Enhance SSL function documentation with detailed environment variable precedence
- Improve error handling in fetch_provider_data with current CA bundle path display
- Add more helpful guidance for SSL certificate configuration issues

Addresses feedback from AI code review and resolves CI lint/security failures.

Co-Authored-By: João <joao@crewai.com>
2025-06-09 14:35:04 +00:00

28 lines
899 B
Python

from crewai.cli.constants import ENV_VARS, JSON_URL, MODELS, PROVIDERS
def test_huggingface_in_providers():
"""Test that Huggingface is in the PROVIDERS list."""
assert "huggingface" in PROVIDERS
def test_huggingface_env_vars():
"""Test that Huggingface environment variables are properly configured."""
assert "huggingface" in ENV_VARS
assert any(
detail.get("key_name") == "HF_TOKEN"
for detail in ENV_VARS["huggingface"]
)
def test_huggingface_models():
"""Test that Huggingface models are properly configured."""
assert "huggingface" in MODELS
assert len(MODELS["huggingface"]) > 0
def test_json_url_is_https():
"""Test that JSON_URL uses HTTPS for secure connection."""
assert JSON_URL.startswith("https://")
assert JSON_URL == "https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json"