Exemple #1
0
def test_ConnectionHandler_setcallback():
    telnet = MockTelnet()
    sentinel = object()
    ch = ConnectionHandler(telnet)
    ch.setcallback(sentinel)
    assert telnet.callback is sentinel
Exemple #2
0
def test_ConnectionHandler_write():
    telnet = MockTelnet()
    ch = ConnectionHandler(telnet)
    ch.write("foo")
    assert telnet.written == "foo"
Exemple #3
0
def test_ConnectionHandler_write():
    telnet = MockTelnet()
    ch = ConnectionHandler(telnet)
    ch.write("foo")
    assert telnet.written == "foo"
Exemple #4
0
def test_ConnectionHandler_setcallback():
    telnet = MockTelnet()
    sentinel = object()
    ch = ConnectionHandler(telnet)
    ch.setcallback(sentinel)
    assert telnet.callback is sentinel
Exemple #5
0
def test_ConnectionHandler_initialisation():
    sentinel = object()
    ch = ConnectionHandler(sentinel)
    assert ch.telnet is sentinel