'Test that global request messages are sent in the right format.'

def test_sendGlobalRequest(self):

    d = self.conn.sendGlobalRequest('wantReply', 'data', True)
    d.addErrback((lambda failure: None))
    self.conn.sendGlobalRequest('noReply', '', False)
    self.assertEqual(self.transport.packets, [(connection.MSG_GLOBAL_REQUEST, (common.NS('wantReply') + '\xffdata')), (connection.MSG_GLOBAL_REQUEST, (common.NS('noReply') + '\x00'))])
    self.assertEqual(self.conn.deferreds, {'global': [d]})
