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

Function test_basic

tests/decoders/test_jsonl.py:16–30  ·  view source on GitHub ↗
(sync: bool)

Source from the content-addressed store, hash-verified

14@pytest.mark.asyncio
15@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"])
16async def test_basic(sync: bool) -> None:
17 def body() -> Iterator[bytes]:
18 yield b'{"foo":true}\n'
19 yield b'{"bar":false}\n'
20
21 iterator = make_jsonl_iterator(
22 content=body(),
23 sync=sync,
24 line_type=object,
25 )
26
27 assert await iter_next(iterator) == {"foo": True}
28 assert await iter_next(iterator) == {"bar": False}
29
30 await assert_empty_iter(iterator)
31
32
33@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"])

Callers

nothing calls this directly

Calls 4

make_jsonl_iteratorFunction · 0.85
bodyFunction · 0.70
iter_nextFunction · 0.70
assert_empty_iterFunction · 0.70

Tested by

no test coverage detected