Python: Add core types and agents unit tests#3470
Merged
giles17 merged 6 commits intomicrosoft:mainfrom Jan 29, 2026
Merged
Conversation
Member
Contributor
There was a problem hiding this comment.
Pull request overview
Adds new unit tests to improve coverage for agent_framework core modules, focusing on content handling/validation utilities and agent option/name logic to support the coverage goals in issue #3356.
Changes:
- Added tests for
Contentbehaviors and internal helpers in_types.py(usage aggregation, media type detection, argument parsing, data URI decoding, content list parsing, URI validation). - Added tests for
_agents.pyinternals and edge cases (option merging, agent name sanitization,ChatAgentinit validation, thread creation).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| python/packages/core/tests/core/test_types.py | Adds coverage for Content operations and _types helper functions around parsing/validation and data URIs. |
| python/packages/core/tests/core/test_agents.py | Adds coverage for agent option merging/name sanitization and ChatAgent initialization/thread creation edge cases. |
moonbox3
approved these changes
Jan 28, 2026
TaoChenOSU
approved these changes
Jan 29, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
This PR adds unit tests to improve coverage for the core
_types.pyand_agents.pymodules as part of issue #3356 (achieving 85-90% unit test coverage for agent-framework-core).Description
Added comprehensive unit tests for:
_types.py (82% → 85%)
_agents.py (81% → 86%)
Contribution Checklist