Skip to content

Commit 5dccce1

Browse files
Merge pull request #802 from microsoft/psl-codeql
fix: Fixed the code quality issue
2 parents eff8b3d + 1409848 commit 5dccce1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/tests/services/test_orchestrator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import base64
22
import json
3+
import sys
34
from unittest.mock import AsyncMock, MagicMock, patch
45

56
import pytest
67

7-
import orchestrator
88
from orchestrator import (_HARMFUL_PATTERNS_COMPILED,
99
_SYSTEM_PROMPT_PATTERNS_COMPILED,
1010
PLANNING_INSTRUCTIONS, RAI_HARMFUL_CONTENT_RESPONSE,
@@ -841,7 +841,7 @@ def test_get_orchestrator_singleton():
841841
mock_builder.return_value = mock_builder_instance
842842

843843
# Reset the singleton
844-
orchestrator._orchestrator = None
844+
sys.modules["orchestrator"]._orchestrator = None
845845

846846
instance1 = get_orchestrator()
847847
instance2 = get_orchestrator()
@@ -1518,7 +1518,7 @@ async def test_get_chat_client_foundry_mode():
15181518
def test_foundry_not_available():
15191519
"""Test when Foundry SDK is not available."""
15201520
# Check that FOUNDRY_AVAILABLE is defined
1521-
assert hasattr(orchestrator, 'FOUNDRY_AVAILABLE')
1521+
assert hasattr(sys.modules["orchestrator"], 'FOUNDRY_AVAILABLE')
15221522

15231523
# Tests for workflow event handling (lines 736-799, 841-895)
15241524
# Note: These are integration-level tests that verify the workflow event

0 commit comments

Comments
 (0)