summaryrefslogtreecommitdiffstats
path: root/testapi
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2017-08-24 18:18:27 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2017-08-24 18:18:27 +0800
commit2a0945fb2e5b0399c7e1fc9061c601a145454186 (patch)
tree52274f949ebbc74b3f1e04525fd2ad13e421fd5c /testapi
parente89188adacacb72c11f557168f7ee48175c93837 (diff)
bugfix: fail to generate APIs document
Change-Id: I13c91fb34e190cd62400eccec6b755419aad89d1 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'testapi')
-rw-r--r--testapi/opnfv_testapi/resources/scenario_handlers.py4
-rw-r--r--testapi/opnfv_testapi/resources/scenario_models.py6
-rw-r--r--testapi/opnfv_testapi/tests/unit/resources/test_scenario.py3
3 files changed, 10 insertions, 3 deletions
diff --git a/testapi/opnfv_testapi/resources/scenario_handlers.py b/testapi/opnfv_testapi/resources/scenario_handlers.py
index bd06400..7ab57c3 100644
--- a/testapi/opnfv_testapi/resources/scenario_handlers.py
+++ b/testapi/opnfv_testapi/resources/scenario_handlers.py
@@ -255,7 +255,7 @@ class ScenarioUpdater(object):
@iter_installers
@iter_versions
def _update_requests_change_owner(self, version):
- version.owner = self.body
+ version.owner = self.body.get('owner')
def _filter_installers(self, installers):
return self._filter('installer', installers)
@@ -587,7 +587,7 @@ class ScenarioOwnerHandler(GenericScenarioUpdateHandler):
@type body: L{string}
@in body: body
@param installer: installer type
- @type installer: L{string}
+ @type installer: L{ScenarioChangeOwnerRequest}
@in installer: query
@required installer: True
@param version: version
diff --git a/testapi/opnfv_testapi/resources/scenario_models.py b/testapi/opnfv_testapi/resources/scenario_models.py
index ec262aa..c6da76b 100644
--- a/testapi/opnfv_testapi/resources/scenario_models.py
+++ b/testapi/opnfv_testapi/resources/scenario_models.py
@@ -161,6 +161,12 @@ class ScenarioCreateRequest(models.ModelBase):
@swagger.model()
+class ScenarioChangeOwnerRequest(models.ModelBase):
+ def __init__(self, owner=None):
+ self.owner = owner
+
+
+@swagger.model()
class Scenario(models.ModelBase):
"""
@property installers:
diff --git a/testapi/opnfv_testapi/tests/unit/resources/test_scenario.py b/testapi/opnfv_testapi/tests/unit/resources/test_scenario.py
index f9bb58c..50a8c8d 100644
--- a/testapi/opnfv_testapi/tests/unit/resources/test_scenario.py
+++ b/testapi/opnfv_testapi/tests/unit/resources/test_scenario.py
@@ -297,8 +297,9 @@ class TestScenarioUpdate(TestScenarioBase):
@update_partial('_update', '_success')
def test_changeOwner(self, scenario):
new_owner = 'new_owner'
+ update = models.ScenarioChangeOwnerRequest(new_owner).format()
scenario['installers'][0]['versions'][0]['owner'] = new_owner
- return new_owner, scenario
+ return update, scenario
def _add(self, update_req, new_scenario):
return self.post_direct_url(self.update_url, update_req)