test(python): cover _common.py URL normalization helpers - #2017
Merged
Merged
Conversation
normalize_base_url, native_base_url, and connect_base_url had no direct tests; every existing test passed a base_url that already ended in /v1, so the append-/v1 branch and the native_base_url strip never ran under test. Add parametrized tests covering a bare root, a trailing slash, an already-normalized /v1 base, a trailing-slash /v1 base, the native_base_url strip and passthrough, and connect_base_url with a given base_url versus the socket-derived UDS_BASE default. Verified the premise still holds on current main: the three helpers remain at python/src/mlxcel/_common.py:70,78,83 with zero prior test hits. Ran pytest python/tests -m "not e2e" -q (43 to 51 passed), ruff check, ruff format --check, and mypy python/src, all clean.
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
normalize_base_url, native_base_url, and connect_base_url in python/src/mlxcel/_common.py had no direct test coverage; every existing test passed a base_url that already ended in /v1, so the append-/v1 branch and the native_base_url strip never ran under test.
What changed
Test plan
Closes #1674