| 372 | @parametrize |
| 373 | @pytest.mark.asyncio |
| 374 | async def test_iterable_of_dictionaries(use_async: bool) -> None: |
| 375 | assert await transform({"foo": [{"foo_baz": "bar"}]}, TypedDictIterableUnion, use_async) == { |
| 376 | "FOO": [{"fooBaz": "bar"}] |
| 377 | } |
| 378 | assert cast(Any, await transform({"foo": ({"foo_baz": "bar"},)}, TypedDictIterableUnion, use_async)) == { |
| 379 | "FOO": [{"fooBaz": "bar"}] |
| 380 | } |
| 381 | |
| 382 | def my_iter() -> Iterable[Baz8]: |
| 383 | yield {"foo_baz": "hello"} |
| 384 | yield {"foo_baz": "world"} |
| 385 | |
| 386 | assert await transform({"foo": my_iter()}, TypedDictIterableUnion, use_async) == { |
| 387 | "FOO": [{"fooBaz": "hello"}, {"fooBaz": "world"}] |
| 388 | } |
| 389 | |
| 390 | |
| 391 | class TypedDictIterableUnionStr(TypedDict): |