(sync: bool, client: Anthropic, async_client: AsyncAnthropic)
| 36 | @pytest.mark.asyncio |
| 37 | @pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) |
| 38 | async def test_basic(sync: bool, client: Anthropic, async_client: AsyncAnthropic) -> None: |
| 39 | def body() -> Iterator[bytes]: |
| 40 | yield b"event: completion\n" |
| 41 | yield b'data: {"foo":true}\n' |
| 42 | yield b"\n" |
| 43 | |
| 44 | iterator = make_event_iterator(content=body(), sync=sync, client=client, async_client=async_client) |
| 45 | |
| 46 | sse = await iter_next(iterator) |
| 47 | assert sse.event == "completion" |
| 48 | assert sse.json() == {"foo": True} |
| 49 | |
| 50 | await assert_empty_iter(iterator) |
| 51 | |
| 52 | |
| 53 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected