mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-11-17 00:20:51 +00:00
* fix(python-client): omit approver from get_resume_urls when not given With approver=None httpx sends `?approver=`, which the server records as an empty approver instead of falling back to "anonymous". get_approval_urls already omits it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore: point get_resume_urls at get_approval_urls' rationale Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
34 lines
872 B
Python
34 lines
872 B
Python
"""The query string get_resume_urls sends, as httpx serialises it."""
|
|
|
|
import httpx
|
|
import pytest
|
|
|
|
from wmill.client import Windmill
|
|
|
|
|
|
def _sent_query(**kwargs) -> dict:
|
|
sent = []
|
|
|
|
def handler(request: httpx.Request) -> httpx.Response:
|
|
sent.append(dict(request.url.params))
|
|
return httpx.Response(200, json={})
|
|
|
|
client = Windmill(base_url="http://wm.test", token="t", workspace="ws")
|
|
client.client = httpx.Client(
|
|
base_url=client.base_url, transport=httpx.MockTransport(handler)
|
|
)
|
|
client.get_resume_urls(**kwargs)
|
|
return sent[0]
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
"kwargs, expected",
|
|
[
|
|
({}, {}),
|
|
({"flow_level": True}, {"flow_level": "true"}),
|
|
({"approver": "alice"}, {"approver": "alice"}),
|
|
],
|
|
)
|
|
def test_get_resume_urls_query(kwargs, expected):
|
|
assert _sent_query(**kwargs) == expected
|