-
Notifications
You must be signed in to change notification settings - Fork 1
notification unit test #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive unit test coverage for the notification models and agent notification functionality in the microsoft-agents-a365-notifications library. The tests cover model initialization, validation, property access, and routing behavior.
Key Changes:
- Added unit tests for NotificationTypes enum covering all enum operations and string comparisons
- Added unit tests for EmailReference and WpxComment models testing initialization, validation, and serialization
- Added unit tests for AgentNotificationActivity testing entity parsing and model conversion
- Added unit tests for AgentNotification class testing route matching and decorator registration
- Updated import path from
microsoft_agents.activitytomicrosoft_agents.activity.channel_idfor ChannelId
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/notifications/models/test_wpx_comment.py | Comprehensive tests for WpxComment model initialization, validation, and property access |
| tests/notifications/models/test_notification_types.py | Tests for NotificationTypes enum values, string operations, and enum behavior |
| tests/notifications/models/test_email_reference.py | Tests for EmailReference model covering initialization, validation, and HTML content handling |
| tests/notifications/models/test_agent_notification_activity.py | Tests for AgentNotificationActivity including entity parsing and model conversion |
| tests/notifications/models/test_agent_notification.py | Tests for AgentNotification class covering route matching, decorators, and subchannel handling |
| tests/notifications/models/init.py | Added copyright header and module docstring for test package |
| tests/notifications/init.py | Added copyright header and module docstring for test package |
| libraries/microsoft-agents-a365-notifications/microsoft_agents_a365/notifications/agent_notification.py | Updated ChannelId import path to be more specific |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 23 out of 24 changed files in this pull request and generated 27 comments.
...icrosoft-agents-a365-notifications/microsoft_agents_a365/notifications/agent_notification.py
Outdated
Show resolved
Hide resolved
tests/microsoft-agents-a365-notification/models/test_notification_types.py
Outdated
Show resolved
Hide resolved
tests/microsoft-agents-a365-notification/models/test_notification_types.py
Outdated
Show resolved
Hide resolved
tests/microsoft-agents-a365-notification/models/test_notification_types.py
Outdated
Show resolved
Hide resolved
tests/microsoft-agents-a365-notification/models/test_notification_types.py
Outdated
Show resolved
Hide resolved
tests/semantickernel_tests/test_semantickernel_service_logic.py
Outdated
Show resolved
Hide resolved
tests/microsoft-agents-a365-tooling-unittest/utils/test_utility.py
Outdated
Show resolved
Hide resolved
tests/microsoft-agents-a365-tooling-unittest/utils/test_utility.py
Outdated
Show resolved
Hide resolved
tests/microsoft-agents-a365-notification/models/test_wpx_comment.py
Outdated
Show resolved
Hide resolved
…y.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 17 out of 18 changed files in this pull request and generated 1 comment.
tests/microsoft-agents-a365-notification/models/test_agent_notification.py
Outdated
Show resolved
Hide resolved
…ub.com/microsoft/Agent365-python into users/anabdul/Unittest_Notification_Py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 18 out of 19 changed files in this pull request and generated 9 comments.
tests/semantickernel_tests/test_semantickernel_service_logic.py
Outdated
Show resolved
Hide resolved
tests/semantickernel_tests/test_semantickernel_service_logic.py
Outdated
Show resolved
Hide resolved
tests/semantickernel_tests/test_semantickernel_service_logic.py
Outdated
Show resolved
Hide resolved
tests/microsoft-agents-a365-tooling-unittest/models/test_mcp_server_config.py
Outdated
Show resolved
Hide resolved
...icrosoft-agents-a365-tooling-unittest/services/test_mcp_tool_server_configuration_service.py
Outdated
Show resolved
Hide resolved
tests/microsoft-agents-a365-tooling-unittest/models/test_mcp_server_config.py
Outdated
Show resolved
Hide resolved
tests/microsoft-agents-a365-tooling-unittest/models/test_mcp_server_config.py
Outdated
Show resolved
Hide resolved
...icrosoft-agents-a365-tooling-unittest/services/test_mcp_tool_server_configuration_service.py
Outdated
Show resolved
Hide resolved
...icrosoft-agents-a365-tooling-unittest/services/test_mcp_tool_server_configuration_service.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 18 out of 19 changed files in this pull request and generated 10 comments.
...-agents-a365-tooling-extensions-semantickernel-unittest/test_semantickernel_service_logic.py
Show resolved
Hide resolved
tests/microsoft-agents-a365-tooling-extensions-openai-unittest/test_openai_service_logic.py
Show resolved
Hide resolved
...-agents-a365-tooling-extensions-azureaifoundry-unittest/test_azureaifoundry_service_logic.py
Show resolved
Hide resolved
...icrosoft-agents-a365-tooling-unittest/services/test_mcp_tool_server_configuration_service.py
Show resolved
Hide resolved
tests/microsoft-agents-a365-tooling-unittest/models/test_mcp_server_config.py
Outdated
Show resolved
Hide resolved
tests/microsoft-agents-a365-notification/models/test_notification_types.py
Show resolved
Hide resolved
tests/microsoft-agents-a365-tooling-unittest/models/test_mcp_server_config.py
Outdated
Show resolved
Hide resolved
- Standardized all test files to use 'Copyright (c) Microsoft Corporation.' - Added 'Licensed under the MIT License.' to comply with Microsoft coding standards - Updated 9 test files across notification and tooling unittest modules - Ensures consistency with Microsoft open source project requirements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 18 out of 19 changed files in this pull request and generated 6 comments.
tests/microsoft-agents-a365-notification/models/test_agent_notification_activity.py
Show resolved
Hide resolved
tests/microsoft-agents-a365-notification/models/test_agent_notification.py
Show resolved
Hide resolved
tests/microsoft-agents-a365-tooling-unittest/utils/test_utility.py
Outdated
Show resolved
Hide resolved
juliomenendez
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the .coverage file in the repo?
The license header should say Copyright (c) Microsoft Corporation. All rights reserved., nothing related to MIT license.
tests/microsoft-agents-a365-notification/models/test_agent_notification.py
Outdated
Show resolved
Hide resolved
tests/microsoft-agents-a365-tooling-unittest/utils/test_constants.py
Outdated
Show resolved
Hide resolved
tests/microsoft-agents-a365-tooling-unittest/utils/test_utility.py
Outdated
Show resolved
Hide resolved
tests/microsoft-agents-a365-tooling-extensions-openai-unittest/test_openai_service_logic.py
Show resolved
Hide resolved
...-agents-a365-tooling-extensions-semantickernel-unittest/test_semantickernel_service_logic.py
Show resolved
Hide resolved
|
Please provide a description for the PR. |
…, remove .NET env vars, rename test directories, remove .coverage file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 18 out of 19 changed files in this pull request and generated 17 comments.
| str: The current environment name. | ||
| """ | ||
| return os.getenv("ASPNETCORE_ENVIRONMENT") or os.getenv("DOTNET_ENVIRONMENT") or "Development" | ||
| return os.getenv("ENVIRONMENT") or "Development" |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removed environment variables ASPNETCORE_ENVIRONMENT and DOTNET_ENVIRONMENT are referenced by "Kairo" in existing code files. According to custom guideline 1000000, the keyword "Kairo" should be removed or replaced with appropriate terminology. Multiple files in the codebase contain "Kairo" references including comments like "Kairo Python SDK", "Kairo tracer", "KairoInstrumentorOpenAIAgents" class names, and module descriptions mentioning "Kairo SDK". These should be updated to use Microsoft-appropriate terminology.
| @@ -0,0 +1,177 @@ | |||
| # Copyright (c) Microsoft. All rights reserved. | |||
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The copyright header format should be "# Copyright (c) Microsoft Corporation." with "Corporation" included, and "# Licensed under the MIT License." on the second line.
| @@ -0,0 +1,5 @@ | |||
| # Copyright (c) Microsoft. All rights reserved. | |||
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The copyright header format should be "# Copyright (c) Microsoft Corporation." with "Corporation" included, and "# Licensed under the MIT License." on the second line.
| @@ -0,0 +1,746 @@ | |||
| # Copyright (c) Microsoft. All rights reserved. | |||
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The copyright header format should be "# Copyright (c) Microsoft Corporation." with "Corporation" included, and "# Licensed under the MIT License." on the second line.
| @@ -0,0 +1,5 @@ | |||
| # Copyright (c) Microsoft. All rights reserved. | |||
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The copyright header format should be "# Copyright (c) Microsoft Corporation." with "Corporation" included, and "# Licensed under the MIT License." on the second line.
| @@ -0,0 +1,255 @@ | |||
| # Copyright (c) Microsoft. All rights reserved. | |||
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The copyright header format should be "# Copyright (c) Microsoft Corporation." with "Corporation" included, and "# Licensed under the MIT License." on the second line.
| @@ -0,0 +1,386 @@ | |||
| # Copyright (c) Microsoft. All rights reserved. | |||
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The copyright header format should be "# Copyright (c) Microsoft Corporation." with "Corporation" included, and "# Licensed under the MIT License." on the second line.
| @@ -0,0 +1,385 @@ | |||
| # Copyright (c) Microsoft. All rights reserved. | |||
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The copyright header format should be "# Copyright (c) Microsoft Corporation." with "Corporation" included, and "# Licensed under the MIT License." on the second line.
| @@ -0,0 +1,5 @@ | |||
| # Copyright (c) Microsoft. All rights reserved. | |||
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The copyright header format should be "# Copyright (c) Microsoft Corporation." with "Corporation" included, and "# Licensed under the MIT License." on the second line.
| @@ -0,0 +1,5 @@ | |||
| # Copyright (c) Microsoft. All rights reserved. | |||
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The copyright header format should be "# Copyright (c) Microsoft Corporation." with "Corporation" included, and "# Licensed under the MIT License." on the second line.
tests/microsoft-agents-a365-notification/models/test_agent_notification.py
Outdated
Show resolved
Hide resolved
tests/microsoft-agents-a365-notification/models/test_agent_notification.py
Outdated
Show resolved
Hide resolved
...-agents-a365-tooling-extensions-azureaifoundry-unittest/test_azureaifoundry_service_logic.py
Show resolved
Hide resolved
...-agents-a365-tooling-extensions-azureaifoundry-unittest/test_azureaifoundry_service_logic.py
Outdated
Show resolved
Hide resolved
...-agents-a365-tooling-extensions-azureaifoundry-unittest/test_azureaifoundry_service_logic.py
Outdated
Show resolved
Hide resolved
...-agents-a365-tooling-extensions-azureaifoundry-unittest/test_azureaifoundry_service_logic.py
Outdated
Show resolved
Hide resolved
| result = get_tools_mode() | ||
|
|
||
| # Assert | ||
| assert result == ToolsMode.MOCK_MCP_SERVER |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought toolsMode was removed from the code. Can you confirm? If not, then we should think if we need to remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 19 out of 20 changed files in this pull request and generated 2 comments.
| def get_ppapi_token_scope(): | ||
| """ | ||
| Gets the MCP platform authentication scope based on the current environment. |
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function name get_ppapi_token_scope doesn't match the docstring which refers to 'MCP platform authentication scope'. The docstring should be updated to reflect that this returns the Power Platform API token scope.
| assert email_string == "Type: NotificationTypes.EMAIL_NOTIFICATION" | ||
| assert wpx_string == "Type: NotificationTypes.WPX_COMMENT" | ||
| assert lifecycle_string == "Type: NotificationTypes.AGENT_LIFECYCLE" |
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test expects enum string formatting to include the enum class name (e.g., 'NotificationTypes.EMAIL_NOTIFICATION'), but Python's f-string formatting with enum values typically just returns the value itself (e.g., 'emailNotification'). Unless the enum has a custom __str__ method, this test will likely fail.
rahuldevikar761
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested feedback on the chat. Please take a look
Adding unit tests to tooling, tooling extensions as well as notifications