Skip to content

Commit a94e78b

Browse files
Testcases
1 parent 8461a50 commit a94e78b

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

src/backend/tests/agents/test_human.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@
88
from unittest.mock import AsyncMock, MagicMock, patch
99
import pytest
1010

11-
sys.modules["azure.monitor.events.extension"] = MagicMock()
11+
# Project-specific imports
12+
from autogen_core.base import AgentInstantiationContext, AgentRuntime
13+
from src.backend.agents.human import HumanAgent
14+
from src.backend.models.messages import HumanFeedback, Step, StepStatus, BAgentType
1215

13-
# Environment and Mock setup (must be before imports)
16+
# Set environment variables before any imports to avoid runtime errors
1417
os.environ["COSMOSDB_ENDPOINT"] = "https://mock-endpoint"
1518
os.environ["COSMOSDB_KEY"] = "mock-key"
1619
os.environ["COSMOSDB_DATABASE"] = "mock-database"
@@ -20,15 +23,8 @@
2023
os.environ["AZURE_OPENAI_API_VERSION"] = "2023-01-01"
2124
os.environ["AZURE_OPENAI_ENDPOINT"] = "https://mock-openai-endpoint"
2225

23-
24-
from autogen_core.base import AgentInstantiationContext, AgentRuntime
25-
from src.backend.agents.human import HumanAgent
26-
from src.backend.models.messages import (
27-
HumanFeedback,
28-
Step,
29-
StepStatus,
30-
BAgentType,
31-
)
26+
# Mock Azure modules
27+
sys.modules["azure.monitor.events.extension"] = MagicMock()
3228

3329

3430
@pytest.fixture

0 commit comments

Comments
 (0)