MCPcopy Create free account
hub / github.com/anomalyco/opencode-sdk-python / test_request_extra_query

Method test_request_extra_query

tests/test_client.py:387–426  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

385 assert request.headers.get("X-Bar") == "false"
386
387 def test_request_extra_query(self) -> None:
388 request = self.client._build_request(
389 FinalRequestOptions(
390 method="post",
391 url="/foo",
392 **make_request_options(
393 extra_query={"my_query_param": "Foo"},
394 ),
395 ),
396 )
397 params = dict(request.url.params)
398 assert params == {"my_query_param": "Foo"}
399
400 # if both `query` and `extra_query` are given, they are merged
401 request = self.client._build_request(
402 FinalRequestOptions(
403 method="post",
404 url="/foo",
405 **make_request_options(
406 query={"bar": "1"},
407 extra_query={"foo": "2"},
408 ),
409 ),
410 )
411 params = dict(request.url.params)
412 assert params == {"bar": "1", "foo": "2"}
413
414 # `extra_query` takes priority over `query` when keys clash
415 request = self.client._build_request(
416 FinalRequestOptions(
417 method="post",
418 url="/foo",
419 **make_request_options(
420 query={"foo": "1"},
421 extra_query={"foo": "2"},
422 ),
423 ),
424 )
425 params = dict(request.url.params)
426 assert params == {"foo": "2"}
427
428 def test_multipart_repeating_array(self, client: Opencode) -> None:
429 request = client._build_request(

Callers

nothing calls this directly

Calls 3

FinalRequestOptionsClass · 0.90
make_request_optionsFunction · 0.90
_build_requestMethod · 0.80

Tested by

no test coverage detected