| 416 | @parametrize |
| 417 | @pytest.mark.asyncio |
| 418 | async 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 |