

@test.create_stubs({
    neutronclient: ('list_ipsecpolicies', 'list_ipsec_site_connections'),
})
def test_ipsecpolicy_list(self):
    ipsecpolicies = {
        'ipsecpolicies': self.ipsecpolicies.list(),
    }
    ipsecpolicies_dict = {
        'ipsecpolicies': self.api_ipsecpolicies.list(),
    }
    ipsecsiteconnections_dict = {
        'ipsec_site_connections': self.api_ipsecsiteconnections.list(),
    }
    neutronclient.list_ipsecpolicies().AndReturn(ipsecpolicies_dict)
    neutronclient.list_ipsec_site_connections().AndReturn(ipsecsiteconnections_dict)
    self.mox.ReplayAll()
    ret_val = api.vpn.ipsecpolicy_list(self.request)
    for (v, d) in zip(ret_val, ipsecpolicies['ipsecpolicies']):
        self.assertIsInstance(d, api.vpn.IPSecPolicy)
        self.assertTrue(v.name, d.name)
        self.assertTrue(v.id)

dataset/ETHPy150Open CiscoSystems/avos/openstack_dashboard/test/api_tests/vpnaas_tests.py VPNaasApiTests.test_ipsecpolicy_list/VarMisuse@146/231 `v`->`d`