

@test.create_stubs({
    neutronclient: ('create_ikepolicy',),
})
def test_ikepolicy_create(self):
    ikepolicy1 = self.api_ikepolicies.first()
    form_data = {
        'name': ikepolicy1['name'],
        'description': ikepolicy1['description'],
        'auth_algorithm': ikepolicy1['auth_algorithm'],
        'encryption_algorithm': ikepolicy1['encryption_algorithm'],
        'ike_version': ikepolicy1['ike_version'],
        'lifetime': ikepolicy1['lifetime'],
        'phase1_negotiation_mode': ikepolicy1['phase1_negotiation_mode'],
        'pfs': ikepolicy1['pfs'],
    }
    ikepolicy = {
        'ikepolicy': self.api_ikepolicies.first(),
    }
    neutronclient.create_ikepolicy({
        'ikepolicy': form_data,
    }).AndReturn(ikepolicy)
    self.mox.ReplayAll()
    ret_val = api.vpn.ikepolicy_create(self.request, **form_data)
    self.assertIsInstance(ret_val, api.vpn.IKEPolicy)

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