MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / test_event_missing_data

Function test_event_missing_data

tests/test_streaming.py:71–82  ·  view source on GitHub ↗
(sync: bool, client: Anthropic, async_client: AsyncAnthropic)

Source from the content-addressed store, hash-verified

69@pytest.mark.asyncio
70@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"])
71async def test_event_missing_data(sync: bool, client: Anthropic, async_client: AsyncAnthropic) -> None:
72 def body() -> Iterator[bytes]:
73 yield b"event: ping\n"
74 yield b"\n"
75
76 iterator = make_event_iterator(content=body(), sync=sync, client=client, async_client=async_client)
77
78 sse = await iter_next(iterator)
79 assert sse.event == "ping"
80 assert sse.data == ""
81
82 await assert_empty_iter(iterator)
83
84
85@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 4

make_event_iteratorFunction · 0.85
bodyFunction · 0.70
iter_nextFunction · 0.70
assert_empty_iterFunction · 0.70

Tested by

no test coverage detected