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