

@test.create_stubs({
    neutronclient: ('create_vpnservice',),
})
def test_vpnservice_create(self):
    vpnservice1 = self.api_vpnservices.first()
    form_data = {
        'name': vpnservice1['name'],
        'description': vpnservice1['description'],
        'subnet_id': vpnservice1['subnet_id'],
        'router_id': vpnservice1['router_id'],
        'admin_state_up': vpnservice1['admin_state_up'],
    }
    vpnservice = {
        'vpnservice': self.api_vpnservices.first(),
    }
    neutronclient.create_vpnservice({
        'vpnservice': form_data,
    }).AndReturn(vpnservice)
    self.mox.ReplayAll()
    ret_val = api.vpn.vpnservice_create(self.request, **form_data)
    self.assertIsInstance(ret_val, api.vpn.VPNService)

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