def test_terminate_invokes_loseConnection(self): protocol = mock.Mock() t = twisted.twisted_transport(protocol) t.terminate() self.assertEqual(1, protocol.transport.loseConnection.call_count)
def __init__(self, avatar, interactive): self.stransport = ttransport.twisted_transport(self) self.interactive = interactive self.avatar = avatar self.session = self.avatar.sfactory(self.stransport)
def test_write_uses_protocol_transport(self): protocol = mock.Mock() t = twisted.twisted_transport(protocol) t.write("foobar") protocol.transport.write.assert_called_with("foobar")