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

Function test_basic

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

Source from the content-addressed store, hash-verified

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