Пример #1
0
def test_send_disconnected(patch_connection, writer, events, run):
    ''' Nothing happens when sending after disconnecting '''
    conn = Connection("host", "port", events, "UTF-8", True)
    run(conn.connect())
    run(conn.disconnect())
    conn.send("test")
    assert not writer.used
Пример #2
0
def test_send_before_connected(patch_connection, writer, events, run):
    ''' Nothing happens when sending before connecting '''
    conn = Connection("host", "port", events, "UTF-8", True)
    assert not conn.connected
    conn.send("test")
    assert not writer.used