Skip to content

Commit 2d8a18f

Browse files
author
TadakiAsechi
committed
Update tests to validate overriding multiple MessageSendConfiguration fields
1 parent 090310f commit 2d8a18f

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

tests/client/test_base_client.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,12 @@ async def test_send_message_callsite_config_overrides_history_length_non_streami
139139
status=TaskStatus(state=TaskState.completed),
140140
)
141141

142-
cfg = MessageSendConfiguration(history_length=2)
142+
# history_length だけでなく、複数フィールドを明示的に上書き
143+
cfg = MessageSendConfiguration(
144+
history_length=2,
145+
blocking=False,
146+
accepted_output_modes=['application/json'],
147+
)
143148
events = [
144149
event
145150
async for event in base_client.send_message(
@@ -155,11 +160,8 @@ async def test_send_message_callsite_config_overrides_history_length_non_streami
155160

156161
params = mock_transport.send_message.await_args.args[0]
157162
assert params.configuration.history_length == 2
158-
assert params.configuration.blocking == (not base_client._config.polling)
159-
assert (
160-
params.configuration.accepted_output_modes
161-
== base_client._config.accepted_output_modes
162-
)
163+
assert params.configuration.blocking is False
164+
assert params.configuration.accepted_output_modes == ['application/json']
163165

164166

165167
@pytest.mark.asyncio
@@ -178,7 +180,11 @@ async def create_stream(*args, **kwargs):
178180

179181
mock_transport.send_message_streaming.return_value = create_stream()
180182

181-
cfg = MessageSendConfiguration(history_length=0)
183+
cfg = MessageSendConfiguration(
184+
history_length=0,
185+
blocking=True,
186+
accepted_output_modes=['text/plain'],
187+
)
182188
events = [
183189
event
184190
async for event in base_client.send_message(
@@ -194,8 +200,5 @@ async def create_stream(*args, **kwargs):
194200

195201
params = mock_transport.send_message_streaming.call_args.args[0]
196202
assert params.configuration.history_length == 0
197-
assert params.configuration.blocking == (not base_client._config.polling)
198-
assert (
199-
params.configuration.accepted_output_modes
200-
== base_client._config.accepted_output_modes
201-
)
203+
assert params.configuration.blocking is True
204+
assert params.configuration.accepted_output_modes == ['text/plain']

0 commit comments

Comments
 (0)