Example #1
0
 def test_terminate_invokes_loseConnection(self):
     protocol = mock.Mock()
     t = twisted.twisted_transport(protocol)
     t.terminate()
     self.assertEqual(1, protocol.transport.loseConnection.call_count)
Example #2
0
 def __init__(self, avatar, interactive):
     self.stransport = ttransport.twisted_transport(self)
     self.interactive = interactive
     self.avatar = avatar
     self.session = self.avatar.sfactory(self.stransport)
Example #3
0
 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")