

@test.create_stubs({
    neutronclient: ('list_vpnservices', 'list_ipsec_site_connections'),
    api.neutron: ('subnet_list', 'router_list'),
})
def test_vpnservice_list(self):
    vpnservices = {
        'vpnservices': self.vpnservices.list(),
    }
    vpnservices_dict = {
        'vpnservices': self.api_vpnservices.list(),
    }
    subnets = self.subnets.list()
    routers = self.routers.list()
    ipsecsiteconnections_dict = {
        'ipsec_site_connections': self.api_ipsecsiteconnections.list(),
    }
    neutronclient.list_vpnservices().AndReturn(vpnservices_dict)
    api.neutron.subnet_list(self.request).AndReturn(subnets)
    api.neutron.router_list(self.request).AndReturn(routers)
    neutronclient.list_ipsec_site_connections().AndReturn(ipsecsiteconnections_dict)
    self.mox.ReplayAll()
    ret_val = api.vpn.vpnservice_list(self.request)
    for (v, d) in zip(ret_val, vpnservices['vpnservices']):
        self.assertIsInstance(v, api.vpn.VPNService)
        self.assertTrue(v.name, d.name)
        self.assertTrue(v.id)

dataset/ETHPy150Open CiscoSystems/avos/openstack_dashboard/test/api_tests/vpnaas_tests.py VPNaasApiTests.test_vpnservice_list/original