def test_constructor(): """ WHEN Channel is constructed. EXPECT It is not closed. """ q = asyncio.Queue() ch = Channel(q) assert not ch.is_closed()
def test_close(): """ GIVEN Channel is open. WHEN close() is called on a Channel. EXPECT It is closed. """ q = asyncio.Queue() ch = Channel(q) ch.close() assert ch.is_closed()