diff options
author | SerenaFeng <feng.xiaowei@zte.com.cn> | 2017-08-21 17:27:52 +0800 |
---|---|---|
committer | SerenaFeng <feng.xiaowei@zte.com.cn> | 2017-08-21 17:34:06 +0800 |
commit | d36c8831a33f0c91d5eec8817ba835393406d6bd (patch) | |
tree | 14e57e6a81327de79e92655b78d58b35e3ea4f91 /utils/test/testapi/opnfv_testapi/tests/unit | |
parent | 13b7ba7e2976ddbafb0dfa7b8bee6a3351c1f187 (diff) |
change scenario owner
1 bugfix owner must be explicit in ScenarioVersion model
2 change owner of scenario
3. usage: PUT /api/v1/scenarios/<scenario_name>/owner? \
installer=<installer_name>& \
version=<version_name>
body: new owner
Change-Id: I261468cd8445030b61e37e0f804b699d6205bdb0
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 | 9 |
1 files changed, 8 insertions, 1 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 8c54e7d74..466caaf13 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 @@ -172,7 +172,7 @@ class TestScenarioUpdate(TestScenarioBase): def _update_url_fixture(xstep): def wrapper(self, *args, **kwargs): locator = None - if item == 'projects': + if item in ['projects', 'owner']: locator = 'installer={}&version={}'.format( self.installer, self.version) @@ -294,6 +294,13 @@ class TestScenarioUpdate(TestScenarioBase): projects) return deletes, scenario + @update_url_fixture('owner') + @update_partial('_update', '_success') + def test_changeOwner(self, scenario): + new_owner = 'new_owner' + scenario['installers'][0]['versions'][0]['owner'] = 'www' + return new_owner, scenario + def _add(self, update_req, new_scenario): return self.post_direct_url(self.update_url, update_req) |