mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-05-06 01:32:36 +00:00
chore: address github-code-quality findings
This commit is contained in:
@@ -17,7 +17,7 @@ class TestPlusAPI(unittest.TestCase):
|
||||
self.assertEqual(self.api.api_key, self.api_key)
|
||||
self.assertEqual(self.api.headers["Authorization"], f"Bearer {self.api_key}")
|
||||
self.assertEqual(self.api.headers["Content-Type"], "application/json")
|
||||
self.assertTrue("CrewAI-CLI/" in self.api.headers["User-Agent"])
|
||||
self.assertIn("CrewAI-CLI/", self.api.headers["User-Agent"])
|
||||
self.assertTrue(self.api.headers["X-Crewai-Version"])
|
||||
|
||||
@patch("crewai_cli.plus_api.PlusAPI._make_request")
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
"""Tests for TokenManager with atomic file operations."""
|
||||
|
||||
import json
|
||||
import os
|
||||
import tempfile
|
||||
import unittest
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
@@ -12,22 +12,28 @@ class BaseProvider(ABC):
|
||||
self.settings = settings
|
||||
|
||||
@abstractmethod
|
||||
def get_authorize_url(self) -> str: ...
|
||||
def get_authorize_url(self) -> str:
|
||||
"""Return the authorization endpoint URL."""
|
||||
|
||||
@abstractmethod
|
||||
def get_token_url(self) -> str: ...
|
||||
def get_token_url(self) -> str:
|
||||
"""Return the token endpoint URL."""
|
||||
|
||||
@abstractmethod
|
||||
def get_jwks_url(self) -> str: ...
|
||||
def get_jwks_url(self) -> str:
|
||||
"""Return the JWKS endpoint URL."""
|
||||
|
||||
@abstractmethod
|
||||
def get_issuer(self) -> str: ...
|
||||
def get_issuer(self) -> str:
|
||||
"""Return the OAuth issuer identifier."""
|
||||
|
||||
@abstractmethod
|
||||
def get_audience(self) -> str: ...
|
||||
def get_audience(self) -> str:
|
||||
"""Return the OAuth audience identifier."""
|
||||
|
||||
@abstractmethod
|
||||
def get_client_id(self) -> str: ...
|
||||
def get_client_id(self) -> str:
|
||||
"""Return the OAuth client identifier."""
|
||||
|
||||
def get_required_fields(self) -> list[str]:
|
||||
"""Returns which provider-specific fields inside the "extra" dict will be required."""
|
||||
|
||||
@@ -182,7 +182,4 @@ class TokenManager:
|
||||
"""
|
||||
storage_path = self._get_secure_storage_path()
|
||||
file_path = storage_path / filename
|
||||
try:
|
||||
file_path.unlink()
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
file_path.unlink(missing_ok=True)
|
||||
|
||||
@@ -11,7 +11,6 @@ from crewai.llms.providers.openai.completion import OpenAICompletion, ResponsesA
|
||||
from crewai.crew import Crew
|
||||
from crewai.agent import Agent
|
||||
from crewai.task import Task
|
||||
from crewai.constants import DEFAULT_LLM_MODEL
|
||||
|
||||
def test_openai_completion_is_used_when_openai_provider():
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user