diff options
author | SerenaFeng <feng.xiaowei@zte.com.cn> | 2017-08-23 15:54:45 +0800 |
---|---|---|
committer | SerenaFeng <feng.xiaowei@zte.com.cn> | 2017-08-25 13:55:38 +0800 |
commit | 30d7e5ef5091144ea22185bb27c7e3900d7b6a45 (patch) | |
tree | 202fb7f0e7e868b913a645ba3441f40a7e648ec0 /utils/test/testapi/opnfv_testapi/tests/unit | |
parent | 858f34a8a3bd8949260dc37f87d13864617ad944 (diff) |
update scenario name
url PUT /api/v1/scenarios/<scenario_name>
if new_name already exist, return Forbidden
if new_name == name, return Forbidden
Change-Id: If3b82b3df4a763d60dad110caca2659c5f39ab50
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'utils/test/testapi/opnfv_testapi/tests/unit')
-rw-r--r-- | utils/test/testapi/opnfv_testapi/tests/unit/resources/test_scenario.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_scenario.py b/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_scenario.py index 4f0fad4df..1367fc669 100644 --- a/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_scenario.py +++ b/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_scenario.py @@ -179,6 +179,8 @@ class TestScenarioUpdate(TestScenarioBase): elif item in ['versions']: locator = 'installer={}'.format( self.installer) + elif item in ['rename']: + self.update_url = self.scenario_url if locator: self.update_url = '{}?{}'.format(self.update_url, locator) @@ -409,6 +411,21 @@ class TestScenarioUpdate(TestScenarioBase): installers) return deletes + @update_url_fixture('rename') + @update_partial('_update', '_success') + def test_renameScenario(self): + new_name = 'new_scenario_name' + update = models.ScenarioUpdateRequest(name=new_name) + self.req_d['name'] = new_name + return update + + @update_url_fixture('rename') + @update_partial('_update', '_forbidden') + def test_renameScenario_exist(self): + new_name = self.req_d['name'] + update = models.ScenarioUpdateRequest(name=new_name) + return update + def _add(self, update_req): return self.post_direct_url(self.update_url, update_req) |