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

Function test_iterable_of_dictionaries

tests/test_transform.py:418–432  ·  view source on GitHub ↗
(use_async: bool)

Source from the content-addressed store, hash-verified

416@parametrize
417@pytest.mark.asyncio
418async def test_iterable_of_dictionaries(use_async: bool) -> None:
419 assert await transform({"foo": [{"foo_baz": "bar"}]}, TypedDictIterableUnion, use_async) == {
420 "FOO": [{"fooBaz": "bar"}]
421 }
422 assert cast(Any, await transform({"foo": ({"foo_baz": "bar"},)}, TypedDictIterableUnion, use_async)) == {
423 "FOO": [{"fooBaz": "bar"}]
424 }
425
426 def my_iter() -> Iterable[Baz8]:
427 yield {"foo_baz": "hello"}
428 yield {"foo_baz": "world"}
429
430 assert await transform({"foo": my_iter()}, TypedDictIterableUnion, use_async) == {
431 "FOO": [{"fooBaz": "hello"}, {"fooBaz": "world"}]
432 }
433
434
435@parametrize

Callers

nothing calls this directly

Calls 2

my_iterFunction · 0.85
transformFunction · 0.70

Tested by

no test coverage detected