

@test.create_stubs({
    neutronclient: ('create_ipsec_site_connection',),
})
def test_ipsecsiteconnection_create(self):
    ipsecsiteconnection1 = self.api_ipsecsiteconnections.first()
    form_data = {
        'name': ipsecsiteconnection1['name'],
        'description': ipsecsiteconnection1['description'],
        'dpd': ipsecsiteconnection1['dpd'],
        'ikepolicy_id': ipsecsiteconnection1['ikepolicy_id'],
        'initiator': ipsecsiteconnection1['initiator'],
        'ipsecpolicy_id': ipsecsiteconnection1['ipsecpolicy_id'],
        'mtu': ipsecsiteconnection1['mtu'],
        'peer_address': ipsecsiteconnection1['peer_address'],
        'peer_cidrs': ipsecsiteconnection1['peer_cidrs'],
        'peer_id': ret_val['peer_id'],
        'psk': ipsecsiteconnection1['psk'],
        'vpnservice_id': ipsecsiteconnection1['vpnservice_id'],
        'admin_state_up': ipsecsiteconnection1['admin_state_up'],
    }
    ipsecsiteconnection = {
        'ipsec_site_connection': self.api_ipsecsiteconnections.first(),
    }
    neutronclient.create_ipsec_site_connection({
        'ipsec_site_connection': form_data,
    }).AndReturn(ipsecsiteconnection)
    self.mox.ReplayAll()
    ret_val = api.vpn.ipsecsiteconnection_create(self.request, **form_data)
    self.assertIsInstance(ret_val, api.vpn.IPSecSiteConnection)

dataset/ETHPy150Open CiscoSystems/avos/openstack_dashboard/test/api_tests/vpnaas_tests.py VPNaasApiTests.test_ipsecsiteconnection_create/VarMisuse@116/235 `ipsecsiteconnection1`->`ret_val`