test(py): add unit tests for wrap_gemini wrapper function#2822
Open
saikiranAnnam wants to merge 2 commits into
Open
test(py): add unit tests for wrap_gemini wrapper function#2822saikiranAnnam wants to merge 2 commits into
saikiranAnnam wants to merge 2 commits into
Conversation
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.
Closes #2818
Problem
wrap_geminiwas introduced inlangsmith 0.4.33but didn’t have direct unit tests covering the public wrapper, only the internal processing helpers (_process_gemini_inputs,_create_usage_metadata, etc.) were tested.This meant the public import path and wrapping behavior weren’t protected against regressions.
Changes
Adds
python/tests/unit_tests/wrappers/test_wrap_gemini.pywith 9 unit tests:test_importable_from_langsmith_wrapperslangsmith.wrappers.wrap_geminiis accessible (the exactAttributeErrorfrom #2818)test_importable_directlyfrom langsmith.wrappers import wrap_geminiworkstest_in_wrappers_allwrap_geministays in__all__across refactorstest_wraps_sync_generate_contentmodels.generate_contentis replaced and__wrapped__is settest_wraps_sync_generate_content_streamtest_wraps_async_generate_contentaio.models.generate_contentis replaced and__wrapped__is settest_double_wrap_raisesValueErroris raised on a secondwrap_geminicalltest_partial_client_does_not_crashaioor stream methods don't raisetest_beta_warning_emittedLangSmithBetaWarningis emitted (beta API contract)No source changes — tests only. Mock clients require no
google-genaipackage installed.This adds regression protection for the public API surface.
Testing
cd python make format make lint make tests