test(tools): add unit tests for clarify_tool.py#121
Merged
teknium1 merged 1 commit intoNousResearch:mainfrom Feb 28, 2026
Merged
test(tools): add unit tests for clarify_tool.py#121teknium1 merged 1 commit intoNousResearch:mainfrom
teknium1 merged 1 commit intoNousResearch:mainfrom
Conversation
Add comprehensive test coverage for the clarify_tool module: - TestClarifyToolBasics: 5 tests for core functionality - Simple questions, questions with choices, error handling - TestClarifyToolChoicesValidation: 5 tests for choices parameter - MAX_CHOICES enforcement, empty/whitespace handling, type conversion - TestClarifyToolCallbackHandling: 3 tests for callback behavior - Exception handling, question/response trimming - TestCheckClarifyRequirements: 1 test verifying always-true behavior - TestClarifySchema: 6 tests verifying OpenAI function schema - Required/optional parameters, maxItems constraint Total: 20 tests covering all public functions and edge cases.
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.
Summary
Add comprehensive test coverage for the
clarify_toolmodule that handles interactive clarifying questions.Changes
tests/tools/test_clarify_tool.pywith 20 unit testsTest Coverage
TestClarifyToolBasics (5 tests)
TestClarifyToolChoicesValidation (5 tests)
TestClarifyToolCallbackHandling (3 tests)
TestCheckClarifyRequirements (1 test)
TestClarifySchema (6 tests)
Testing
uv run pytest tests/tools/test_clarify_tool.py -v # 20 passed