[claude] Add unit tests for cascade.py (#1138) #1150
Reference in New Issue
Block a user
Delete Branch "claude/issue-1138"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #1138
What
Expands
tests/infrastructure/test_router_cascade.pyfrom 42 unmarked tests (not run bytox -e unit) to 73 fully-marked unit tests.Changes
@pytest.mark.unitto all 12 existing test classes so they are discovered bytox -e unitTestContentTypeDetection— all branches of_detect_content_type()(text, vision, audio, multimodal, list-content)TestTransformMessagesForOllama— message transform for base64, URLs, missing filesTestProviderCapabilityMethods—get_model_with_capability()andmodel_has_capability()TestGetFallbackModel— vision fallback, no-capability fallback, text returns NoneTestCascadeTierFiltering—frontier_required, unknown tier, tier-matched providersTestGenerateWithImage— delegates tocomplete()with images in messagesTestGetRouterSingleton—get_router()creates instance and returns same instanceTestIsProviderAvailable— disabled, healthy, open circuit, half-open transitionTest results
tox -e unit— 93 passed (was 20 before this PR)