Revision 2cd55da6 snf-cyclades-app/synnefo/api/test/networks.py

b/snf-cyclades-app/synnefo/api/test/networks.py
43 43

  
44 44

  
45 45
class ComputeAPITest(BaseAPITest):
46
    def setUp(self, *args, **kwargs):
47
        super(ComputeAPITest, self).setUp(*args, **kwargs)
46
    def __init__(self, *args, **kwargs):
47
        super(ComputeAPITest, self).__init__(*args, **kwargs)
48 48
        self.compute_path = get_service_path(cyclades_services, 'compute',
49 49
                                             version='v2.0')
50

  
50 51
    def myget(self, path, *args, **kwargs):
51 52
        path = join_urls(self.compute_path, path)
52 53
        return self.get(path, *args, **kwargs)
......
372 373
        net = mfactory.NetworkFactory(state='PENDING', subnet='10.0.0.0/31',
373 374
                                      userid=user)
374 375
        request = {'add': {'serverRef': vm.id}}
375
        response = self.mypost('/api/v1.1/networks/%d/action' % net.id,
376
        response = self.mypost('networks/%d/action' % net.id,
376 377
                               net.userid, json.dumps(request), 'json')
377 378
        # Test that returns BuildInProgress
378 379
        self.assertEqual(response.status_code, 409)
......
400 401

  
401 402
    def test_remove_nic(self, mrapi):
402 403
        user = 'userr'
403
        vm = mfactory.VirtualMachineFactory(name='yo', userid=user)
404
        vm = mfactory.VirtualMachineFactory(name='yo', userid=user,
405
                                            operstate="ACTIVE")
404 406
        net = mfactory.NetworkFactory(state='ACTIVE', userid=user)
405 407
        nic = mfactory.NetworkInterfaceFactory(machine=vm, network=net)
406 408
        mrapi().ModifyInstance.return_value = 1

Also available in: Unified diff