Example #1
0
def test_constructor():
    """
    WHEN
        Channel is constructed.
    EXPECT
        It is not closed.
    """
    q = asyncio.Queue()
    ch = Channel(q)
    assert not ch.is_closed()
Example #2
0
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()