Ejemplo n.º 1
0
 def _response_in_resource_get_list(self):
     # response for heat_client's resource_get_list()
     url = self.url + '/stacks/' + self.stack_id + '/resources'
     json = {'resources': [fd_utils.get_dummy_resource()]}
     self.requests_mock.register_uri('GET',
                                     url,
                                     json=json,
                                     headers=self.json_headers)
    def _response_in_resource_get(self, id, res_name=None):
        # response for heat_client's resource_get()
        if res_name:
            url = self.url + '/stacks/' + id + ('/myStack/60f83b5e/'
                                                'resources/') + res_name
        else:
            url = self.url + '/stacks/' + id

        json = {'resource': fd_utils.get_dummy_resource()}
        self.requests_mock.register_uri('GET', url, json=json,
                                        headers=self.json_headers)
 def test_create_wait_with_scaling_group_names(self):
     self._response_in_wait_until_stack_ready(["CREATE_IN_PROGRESS",
                                              "CREATE_COMPLETE"])
     self._response_in_resource_get(self.instance_uuid,
                                    res_name='SP1_group')
     url = self.url + '/stacks/' + self.stack_id + '/resources'
     json = {'resources': [fd_utils.get_dummy_resource()]}
     self.requests_mock.register_uri('GET', url, json=json,
                                     headers=self.json_headers)
     self._response_in_resource_get(self.stack_id)
     vnf_dict = utils.get_dummy_vnf(scaling_group=True)
     self.openstack.create_wait(None, None, vnf_dict, self.instance_uuid,
                                None)
     self.assertEqual('{"vdu1": ["test1"]}', vnf_dict['mgmt_ip_address'])