fix(test): update test_add_and_delete_deployments for new Router behavior#20649
Open
shin-bot-litellm wants to merge 1 commit intomainfrom
Open
fix(test): update test_add_and_delete_deployments for new Router behavior#20649shin-bot-litellm wants to merge 1 commit intomainfrom
shin-bot-litellm wants to merge 1 commit intomainfrom
Conversation
…vior Router is now created even with empty model_list to support search_tools. Update test to verify router exists with empty model_list instead of expecting router to be None.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Shin seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Contributor
Greptile OverviewGreptile SummaryUpdates test assertions to align with Router behavior change introduced in commit ac5c5ee. The
This change is a straightforward test update that matches the production code behavior. Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| tests/local_testing/test_config.py | Updated test assertions to match new Router behavior where Router is created even with empty model list (for search_tools support) |
Sequence Diagram
sequenceDiagram
participant Test as test_add_and_delete_deployments
participant ProxyConfig as ProxyConfig
participant ProxyServer as litellm.proxy.proxy_server
participant Router as litellm.Router
Note over Test: Start with llm_router=None<br/>model_list_flag_value=0 (empty list)
Test->>ProxyServer: setattr(llm_router, None)
Test->>ProxyConfig: _update_llm_router(new_models=[])
ProxyConfig->>ProxyConfig: get_config()
ProxyConfig->>ProxyConfig: parse_search_tools()
alt llm_router is None
Note over ProxyConfig: New behavior: Create Router<br/>even with empty model_list
ProxyConfig->>Router: Router(model_list=[], search_tools=...)
Router-->>ProxyConfig: Router instance
ProxyConfig->>ProxyServer: llm_router = Router instance
end
Test->>ProxyServer: llm_router = getattr(llm_router)
Test->>Test: assert llm_router is not None ✓
Test->>Test: assert len(llm_router.model_list) == 0 ✓
Note over Test: Old behavior expected:<br/>llm_router == None<br/><br/>New behavior validates:<br/>Router created with empty model_list
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
Fixes failing test
test_add_and_delete_deployments[0-None]Root Cause
The
_update_llm_routerfunction was updated to always create a Router even with an empty model list (to supportsearch_tools). See comment in code:The test expectation was outdated - it expected the router to remain
Nonewhen starting withNoneand an empty model list.Fix
Update the test to verify:
Instead of expecting router to be None.
Testing