

@test.create_stubs({
    neutronclient: ('create_ipsecpolicy',),
})
def test_ipsecpolicy_create(self):
    ipsecpolicy1 = self.api_ipsecpolicies.first()
    form_data = {
        'name': ipsecpolicy1['name'],
        'description': ipsecpolicy1['description'],
        'auth_algorithm': ipsecpolicy1['auth_algorithm'],
        'encryption_algorithm': ipsecpolicy1['encryption_algorithm'],
        'encapsulation_mode': ipsecpolicy1['encapsulation_mode'],
        'lifetime': ipsecpolicy1['lifetime'],
        'pfs': ipsecpolicy1['pfs'],
        'transform_protocol': ipsecpolicy1['transform_protocol'],
    }
    ipsecpolicy = {
        'ipsecpolicy': self.api_ipsecpolicies.first(),
    }
    neutronclient.create_ipsecpolicy({
        'ipsecpolicy': form_data,
    }).AndReturn(ipsecpolicy)
    self.mox.ReplayAll()
    ret_val = api.vpn.ipsecpolicy_create(self.request, **form_data)
    self.assertIsInstance(ret_val, api.vpn.IPSecPolicy)

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