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

Function test_basic

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

Source from the content-addressed store, hash-verified

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