

@test.create_stubs({
    neutronclient: ('show_vpnservice', 'list_ipsec_site_connections'),
    api.neutron: ('subnet_get', 'router_get'),
})
def test_vpnservice_get(self):
    vpnservice = self.vpnservices.first()
    vpnservice_dict = {
        'vpnservice': self.api_vpnservices.first(),
    }
    subnet = self.subnets.first()
    router = self.routers.first()
    ipsecsiteconnections_dict = {
        'ipsec_site_connections': self.api_ipsecsiteconnections.list(),
    }
    neutronclient.show_vpnservice(vpnservice.id).AndReturn(vpnservice_dict)
    api.neutron.subnet_get(self.request, subnet.id).AndReturn(subnet)
    api.neutron.router_get(self.request, router.id).AndReturn(router)
    neutronclient.list_ipsec_site_connections().AndReturn(ipsecsiteconnections_dict)
    self.mox.ReplayAll()
    ret_val = api.vpn.vpnservice_get(self.request, vpnservice.id)
    self.assertIsInstance(ret_val, api.vpn.VPNService)

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