async def test_chain_non_iterables(): """Check that chain raises TypeError if given non-iterable values.""" with pytest.raises(TypeError): await aitertools.anext(aitertools.chain(1, 2))
async def test_chain_single_iterable(): """Check if chain works when given only one iterable.""" assert (await aitertools.alist( aitertools.chain('abc') )) == list('abc')
async def test_chain_empty_iterable(): """Check that chain result is empty if all iterables are empty.""" assert (await aitertools.alist( aitertools.chain([]) )) == []
async def test_chain_combines_iterables(): """Check that chain produces values from all iterables.""" assert (await aitertools.alist( aitertools.chain('abc', 'def') )) == list('abcdef')