'Test that global request packets are dispatched to the global_*
methods and the return values are translated into success or failure
messages.'

def test_GLOBAL_REQUEST(self):

    self.conn.ssh_GLOBAL_REQUEST((common.NS('TestGlobal') + '\xff'))
    self.assertEqual(self.transport.packets, [(connection.MSG_REQUEST_SUCCESS, '')])
    self.transport.packets = []
    self.conn.ssh_GLOBAL_REQUEST(((common.NS('TestData') + '\xff') + 'test    data'))
    self.assertEqual(self.transport.packets, [(connection.MSG_REQUEST_SUCCESS, 'test    data')])
    self.transport.packets = []
    self.conn.ssh_GLOBAL_REQUEST((common.NS('TestBad') + '\xff'))
    self.assertEqual(self.transport.packets, [(connection.MSG_REQUEST_FAILURE, '')])
    self.transport.packets = []
    self.conn.ssh_GLOBAL_REQUEST((common.NS('TestGlobal') + '\x00'))
    self.assertEqual(self.transport.packets, [])
