-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* edit 1 * edit 2 * Repository Governance * added stale-bot * stalebot test * chNGED TO 1 DAY * edit 3 * Create test * edit1 * edit2 * edit 4 * edit 5 * edit 6 * edit 6 * edit 7 * edit 8 * edit 5 * edit 10 * edit 11 * edit 12 * edit 13 * Update stale-bot.yml * edit 14 * edit 15 * edit 16 * edit 17 * Update stale-bot.yml * Update CODEOWNER * Create nwetest * added pylint * changed flak loc * edit 1 * add backend test workflow * added test file * edit 2 * added sample test file * changed py version * made edits to workflow * pass even if test filesa r not present * removed test file * added sample test file * Create docker-build-and-push.yml * Delete test * Delete src/backend/middleware/test_health_check.py * Delete .github/nwetest * Delete .github/workflows/CI.yml * updated docker * Testcases * Testcases * Testcases * Update test.yml * Testcases * Testcases * Testcases * Testcases * Testcases * Pylint issues fixed * pylint issues fixed * Pylint issues fixed * Pylint issues fixed * pylint fixed for line * fix for test cases failure * added agentutils test * updated test utils file * Testcases * Testcases * Testcases * Testcases * added genric test file * Testcases * Testcases * Testcases * Testcases * Testcases * Testcases * Testcases * solving pylint errors * resolved pylint errors * edit 2 * resolving pylint * edit 3 * resolved issue * resolve edit 5 * resoleving pylint edit 6 * pylint error edit 7 * Update test.yml * Testcases * Testcases * Testcases * Testcases * Testcases * Testcases * Testcases * Testcases * Testcases * Testcases * Testcases * Testcases * Testcases * Testcases * Testcases * Testcases * Testcases * Testcases * Update test.yml * Update test.yml * Update test.yml * Testcases * Testcases * Testcases * Testcases * Testcases * Testcases * Testcases * Testcases * Testcases * Testcases * Testcases * Testcases * Testcases * Testing * Testing * Testcases * Testcases * Testcases * Testcases * Testcases * Testcases * added test_base_agent file * Testcases * Testcases * Testcases * Testcases * added the test_agentutils and test_base_agent * deleted agentutils.py * Testcases * Testcases * Testcases * Testcases * Testcases * Testcases * Testcases * edited flak * resolved pylint issues * Test case Group_chat_manager * Test case Group_chat_manager * updated test_agentutils.py * editv1 * resolving pylint issue * edit 2 * Testcases * Testcases * Testcases * Testcases * docker changes reverted --------- Co-authored-by: Harmanpreet Kaur <[email protected]> Co-authored-by: Harmanpreet-Microsoft <[email protected]> Co-authored-by: Roopan P M <[email protected]> Co-authored-by: Pradheep-Microsoft <[email protected]>
- Loading branch information
1 parent
be39487
commit f8640d9
Showing
52 changed files
with
3,621 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# pylint: disable=import-error, wrong-import-position, missing-module-docstring | ||
import os | ||
import sys | ||
from unittest.mock import MagicMock | ||
import pytest | ||
from pydantic import ValidationError | ||
|
||
# Environment and module setup | ||
sys.modules["azure.monitor.events.extension"] = MagicMock() | ||
|
||
os.environ["COSMOSDB_ENDPOINT"] = "https://mock-endpoint" | ||
os.environ["COSMOSDB_KEY"] = "mock-key" | ||
os.environ["COSMOSDB_DATABASE"] = "mock-database" | ||
os.environ["COSMOSDB_CONTAINER"] = "mock-container" | ||
os.environ["AZURE_OPENAI_DEPLOYMENT_NAME"] = "mock-deployment-name" | ||
os.environ["AZURE_OPENAI_API_VERSION"] = "2023-01-01" | ||
os.environ["AZURE_OPENAI_ENDPOINT"] = "https://mock-openai-endpoint" | ||
|
||
from src.backend.agents.agentutils import extract_and_update_transition_states # noqa: F401, C0413 | ||
from src.backend.models.messages import Step # noqa: F401, C0413 | ||
|
||
|
||
def test_step_initialization(): | ||
"""Test Step initialization with valid data.""" | ||
step = Step( | ||
data_type="step", | ||
plan_id="test_plan", | ||
action="test_action", | ||
agent="HumanAgent", | ||
session_id="test_session", | ||
user_id="test_user", | ||
agent_reply="test_reply", | ||
) | ||
|
||
assert step.data_type == "step" | ||
assert step.plan_id == "test_plan" | ||
assert step.action == "test_action" | ||
assert step.agent == "HumanAgent" | ||
assert step.session_id == "test_session" | ||
assert step.user_id == "test_user" | ||
assert step.agent_reply == "test_reply" | ||
assert step.status == "planned" | ||
assert step.human_approval_status == "requested" | ||
|
||
|
||
def test_step_missing_required_fields(): | ||
"""Test Step initialization with missing required fields.""" | ||
with pytest.raises(ValidationError): | ||
Step( | ||
data_type="step", | ||
action="test_action", | ||
agent="test_agent", | ||
session_id="test_session", | ||
) |
Oops, something went wrong.