diff options
author | Serena Feng <feng.xiaowei@zte.com.cn> | 2018-05-07 14:14:43 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-05-07 14:14:43 +0000 |
commit | e4c1d703a7784fe8acea8477fc57fb2438201c33 (patch) | |
tree | 4869325ccf6807b8ca65f99674e013a6e49b232f /testapi | |
parent | bdd692287fc028295ef5763c48d2218d6c7e06cb (diff) | |
parent | a2a855bc1b66284addaead40b23f43a574de336d (diff) |
Merge "Add result model to the client"
Diffstat (limited to 'testapi')
-rw-r--r-- | testapi/testapi-client/testapiclient/cli/results.py | 9 | ||||
-rw-r--r-- | testapi/testapi-client/testapiclient/models/result.py | 16 |
2 files changed, 19 insertions, 6 deletions
diff --git a/testapi/testapi-client/testapiclient/cli/results.py b/testapi/testapi-client/testapiclient/cli/results.py index 56ea71f..5500501 100644 --- a/testapi/testapi-client/testapiclient/cli/results.py +++ b/testapi/testapi-client/testapiclient/cli/results.py @@ -2,6 +2,7 @@ import json from testapiclient.utils import command from testapiclient.utils import urlparse +from testapiclient.models import result def results_url(): @@ -86,12 +87,8 @@ class ResultCreate(command.ShowOne): parser.add_argument('result', type=json.loads, help='Result create request format:\n' - '\'{"project_name" : "","scenario" : "",' - '"stop_date" : "", "case_name" : "",' - '"build_tag" : "", "version" : "",' - '"pod_name" : "" , "criteria" : "",' - '"installer" : "", "start_date" : "",' - '"details" : ""}\'') + '\'{}\''.format(json.dumps( + result.ResultCreateRequest().__dict__))) return parser def take_action(self, parsed_args): diff --git a/testapi/testapi-client/testapiclient/models/result.py b/testapi/testapi-client/testapiclient/models/result.py new file mode 100644 index 0000000..766c03a --- /dev/null +++ b/testapi/testapi-client/testapiclient/models/result.py @@ -0,0 +1,16 @@ +class ResultCreateRequest(): + def __init__( + self, project_name='', scenario='', case_name='', pod_name='', + installer='', version='', stop_date='', build_tag='', criteria='', + start_date='', details=''): + self.project_name = project_name + self.scenario = scenario + self.case_name = case_name + self.pod_name = pod_name + self.installer = installer + self.version = version + self.stop_date = stop_date + self.build_tag = build_tag + self.criteria = criteria + self.start_date = start_date + self.details = details |