Skip to content

test(python): cover _common.py URL normalization helpers - #2017

Merged
inureyes merged 3 commits into
mainfrom
test/issue-1674-common-url-helpers
Sep 28, 2026
Merged

inureyes merged 3 commits into
mainfrom
test/issue-1674-common-url-helpers

Conversation

@inureyes

Copy link
Copy Markdown
Member

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

  • python/tests/test_client_mock.py: added a "URL normalization" section with parametrized tests for normalize_base_url (bare root, trailing slash, already /v1, /v1 with trailing slash), native_base_url (strip and passthrough), and connect_base_url (explicit base_url versus the UDS_BASE-derived default).

Test plan

  • Verified the premise on current main: the three helpers are still at _common.py:70/78/83 with zero prior test hits
  • pytest python/tests -m "not e2e" -q (43 passed before, 51 passed after)
  • ruff check python
  • ruff format --check python
  • mypy python/src

Closes #1674

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.
@inureyes inureyes added status:review Under review type:test Test related changes priority:low Low priority status:done Completed and removed status:review Under review labels Sep 28, 2026
@inureyes
inureyes merged commit 4e47f61 into main Sep 28, 2026
28 checks passed
@inureyes
inureyes deleted the test/issue-1674-common-url-helpers branch September 28, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:low Low priority status:done Completed type:test Test related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(python): cover the _common.py URL normalization helpers

1 participant