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

Method test_copy_default_options

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

Source from the content-addressed store, hash-verified

86 assert id(copied) != id(self.client)
87
88 def test_copy_default_options(self) -> None:
89 # options that have a default are overridden correctly
90 copied = self.client.copy(max_retries=7)
91 assert copied.max_retries == 7
92 assert self.client.max_retries == 2
93
94 copied2 = copied.copy(max_retries=6)
95 assert copied2.max_retries == 6
96 assert copied.max_retries == 7
97
98 # timeout
99 assert isinstance(self.client.timeout, httpx.Timeout)
100 copied = self.client.copy(timeout=None)
101 assert copied.timeout is None
102 assert isinstance(self.client.timeout, httpx.Timeout)
103
104 def test_copy_default_headers(self) -> None:
105 client = Opencode(base_url=base_url, _strict_response_validation=True, default_headers={"X-Foo": "bar"})

Callers

nothing calls this directly

Calls 1

copyMethod · 0.45

Tested by

no test coverage detected