chore: ran linter & formatter again
This commit is contained in:
@@ -3,13 +3,14 @@
|
||||
# TODO: Moved directory, should not be necessary anymore but need to check !!
|
||||
# Ajouter le dossier parent (brain) au PYTHONPATH
|
||||
# sys.path.insert(0, str(Path(__file__).parent.parent))
|
||||
import pytest
|
||||
import shutil
|
||||
import sys
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
from unittest.mock import MagicMock, Mock
|
||||
|
||||
import pytest
|
||||
|
||||
from alfred.infrastructure.persistence import Memory, set_memory
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
"""Edge case tests for the Agent."""
|
||||
import pytest
|
||||
|
||||
from unittest.mock import Mock
|
||||
|
||||
import pytest
|
||||
|
||||
from alfred.agent.agent import Agent
|
||||
from alfred.infrastructure.persistence import get_memory
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@ class TestChatCompletionsEdgeCases:
|
||||
|
||||
def test_very_long_message(self, memory):
|
||||
"""Should handle very long user message."""
|
||||
from alfred.app import app
|
||||
from alfred.agent import agent
|
||||
from alfred.app import app
|
||||
|
||||
# Patch the agent's LLM directly
|
||||
mock_llm = Mock()
|
||||
@@ -33,8 +33,8 @@ class TestChatCompletionsEdgeCases:
|
||||
|
||||
def test_unicode_message(self, memory):
|
||||
"""Should handle unicode in message."""
|
||||
from alfred.app import app
|
||||
from alfred.agent import agent
|
||||
from alfred.app import app
|
||||
|
||||
mock_llm = Mock()
|
||||
mock_llm.complete.return_value = {
|
||||
@@ -59,8 +59,8 @@ class TestChatCompletionsEdgeCases:
|
||||
|
||||
def test_special_characters_in_message(self, memory):
|
||||
"""Should handle special characters."""
|
||||
from alfred.app import app
|
||||
from alfred.agent import agent
|
||||
from alfred.app import app
|
||||
|
||||
mock_llm = Mock()
|
||||
mock_llm.complete.return_value = {"role": "assistant", "content": "Response"}
|
||||
@@ -187,8 +187,8 @@ class TestChatCompletionsEdgeCases:
|
||||
|
||||
def test_many_messages(self, memory):
|
||||
"""Should handle many messages in conversation."""
|
||||
from alfred.app import app
|
||||
from alfred.agent import agent
|
||||
from alfred.app import app
|
||||
|
||||
mock_llm = Mock()
|
||||
mock_llm.complete.return_value = {"role": "assistant", "content": "Response"}
|
||||
@@ -301,8 +301,8 @@ class TestChatCompletionsEdgeCases:
|
||||
|
||||
def test_extra_fields_in_request(self, memory):
|
||||
"""Should ignore extra fields in request."""
|
||||
from alfred.app import app
|
||||
from alfred.agent import agent
|
||||
from alfred.app import app
|
||||
|
||||
mock_llm = Mock()
|
||||
mock_llm.complete.return_value = {"role": "assistant", "content": "Response"}
|
||||
@@ -325,8 +325,8 @@ class TestChatCompletionsEdgeCases:
|
||||
|
||||
def test_streaming_with_tool_call(self, memory, real_folder):
|
||||
"""Should handle streaming with tool execution."""
|
||||
from alfred.app import app
|
||||
from alfred.agent import agent
|
||||
from alfred.app import app
|
||||
from alfred.infrastructure.persistence import get_memory
|
||||
|
||||
mem = get_memory()
|
||||
@@ -371,8 +371,8 @@ class TestChatCompletionsEdgeCases:
|
||||
|
||||
def test_concurrent_requests_simulation(self, memory):
|
||||
"""Should handle rapid sequential requests."""
|
||||
from alfred.app import app
|
||||
from alfred.agent import agent
|
||||
from alfred.app import app
|
||||
|
||||
mock_llm = Mock()
|
||||
mock_llm.complete.return_value = {"role": "assistant", "content": "Response"}
|
||||
@@ -392,8 +392,8 @@ class TestChatCompletionsEdgeCases:
|
||||
|
||||
def test_llm_returns_json_in_response(self, memory):
|
||||
"""Should handle LLM returning JSON in text response."""
|
||||
from alfred.app import app
|
||||
from alfred.agent import agent
|
||||
from alfred.app import app
|
||||
|
||||
mock_llm = Mock()
|
||||
mock_llm.complete.return_value = {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
"""Critical tests for configuration validation."""
|
||||
|
||||
import pytest
|
||||
|
||||
from alfred.agent.config import ConfigurationError, Settings
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
"""Edge case tests for configuration and parameters."""
|
||||
|
||||
import os
|
||||
import pytest
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
from alfred.agent.config import ConfigurationError, Settings
|
||||
from alfred.agent.parameters import (
|
||||
REQUIRED_PARAMETERS,
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
"""Edge case tests for domain entities and value objects."""
|
||||
import pytest
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
import pytest
|
||||
|
||||
from alfred.domain.movies.entities import Movie
|
||||
from alfred.domain.movies.value_objects import MovieTitle, Quality, ReleaseYear
|
||||
from alfred.domain.shared.exceptions import ValidationError
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
"""Tests for the Memory system."""
|
||||
import pytest
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
import pytest
|
||||
|
||||
from alfred.infrastructure.persistence import (
|
||||
EpisodicMemory,
|
||||
LongTermMemory,
|
||||
|
||||
@@ -4,6 +4,7 @@ import json
|
||||
import os
|
||||
|
||||
import pytest
|
||||
|
||||
from alfred.infrastructure.persistence import (
|
||||
EpisodicMemory,
|
||||
LongTermMemory,
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import inspect
|
||||
|
||||
import pytest
|
||||
|
||||
from alfred.agent.prompts import PromptBuilder
|
||||
from alfred.agent.registry import Tool, _create_tool_from_function, make_tools
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""Edge case tests for tool registry."""
|
||||
|
||||
import pytest
|
||||
|
||||
from alfred.agent.registry import Tool, make_tools
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
"""Edge case tests for tools."""
|
||||
import pytest
|
||||
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from alfred.agent.tools import api as api_tools
|
||||
from alfred.agent.tools import filesystem as fs_tools
|
||||
from alfred.infrastructure.persistence import get_memory
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
"""Tests for filesystem tools."""
|
||||
import pytest
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from alfred.agent.tools import filesystem as fs_tools
|
||||
from alfred.infrastructure.persistence import get_memory
|
||||
|
||||
|
||||
Reference in New Issue
Block a user