test: add unit tests for API client mixin, search tool, and enhance toolkit tests#28
Closed
billy-schuett-glean wants to merge 2 commits intomainfrom
Closed
test: add unit tests for API client mixin, search tool, and enhance toolkit tests#28billy-schuett-glean wants to merge 2 commits intomainfrom
billy-schuett-glean wants to merge 2 commits intomainfrom
Conversation
…hance GleanToolkit tests - Add test_api_client_mixin.py: 15 tests covering _resolve_env() (constructor args, env vars, override precedence, missing fields) and _http_headers() (act_as set/unset/empty) - Add test_glean_search_tool.py: 16 tests covering _run/_arun with string queries, SearchBasicRequest, dict input, no results, missing metadata, GleanError, and generic errors - Enhance test_glean_toolkit.py: add 4 new tests verifying all tool types present, BaseTool inheritance, unique names, and retriever sharing between toolkit and tools Generated by Glean Code Writer
… tests Generated by Glean Code Writer
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.
Description
Adds unit tests to close coverage gaps and strengthen existing test suites:
test_api_client_mixin.py(new, 15 tests): First dedicated test coverage forGleanAPIClientMixin, the shared auth mixin inherited by all components. Covers_resolve_env()(constructor args, env var fallback, override precedence, missing required fields) and_http_headers()(act_as set/unset/empty string).test_glean_search_tool.py(new, 16 tests): Full coverage forGleanSearchTool._run()and_arun()— string queries,SearchBasicRequest, dict input, no-results, missing metadata defaults,GleanError(with/without raw_response), and generic exceptions.test_glean_toolkit.py(enhanced, +4 tests): Refactored setup into a pytest fixture and added tests for all 6 tool types present,BaseToolinheritance, unique tool names, and retriever instance sharing between toolkit and tools.Testing
mise run test— all 35+ new/enhanced tests pass with network disabled🤖 Generated by Glean Code Writer
📝 Chat link - https://app.glean.com/chat/0997497bbeff45d2a321e8de4ff82632