

def test_create_transport_once(self):
    rpcapi = self.driver.intercell_rpcapi
    transport_url = 'amqp://fakeurl'
    next_hop = fakes.FakeCellState('cellname')
    next_hop.db_info['transport_url'] = transport_url
    with mock.patch.object(oslo_messaging, 'get_transport') as get_trans:
        transport = rpcapi._get_transport(next_hop)
        get_trans.assert_called_once_with(rpc_driver.CONF, transport_url, rpc.TRANSPORT_ALIASES)
        self.assertIn(transport_url, next_hop.transports)
        self.assertEqual(transport, rpcapi.transports[transport_url])
    transport2 = rpcapi._get_transport(next_hop)
    self.assertEqual(transport, transport2)

dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/cells/test_cells_rpc_driver.py CellsRPCDriverTestCase.test_create_transport_once/VarMisuse@86/144 `rpcapi`->`next_hop`