'Test that disconnection messages are sent correctly.  Payload::
uint32 reason code
string reason description
string language'

def test_sendDisconnect(self):

    disconnected = [False]
    def stubLoseConnection():
        disconnected[0] = True
    self.transport.loseConnection = stubLoseConnection
    self.proto.sendDisconnect(255, 'test')
    self.assertEqual(self.packets, [(transport.MSG_DISCONNECT, '\x00\x00\x00\xff\x00\x00\x00\x04test\x00\x00\x00\x00')])
    self.assertTrue(disconnected[0])
