diff options
author | thuva4 <tharma.thuva@gmail.com> | 2018-05-05 12:49:16 +0530 |
---|---|---|
committer | thuva4 <tharma.thuva@gmail.com> | 2018-05-07 10:59:25 +0530 |
commit | a2a855bc1b66284addaead40b23f43a574de336d (patch) | |
tree | fe65c15977849bc1d6b7220c30c405248fac58d0 | |
parent | 71c429c25f30660d436fef7b064553c266d4655a (diff) |
Add result model to the client
Change-Id: I0921835f8d1042b2d0c12f3972bda24736741d55
Signed-off-by: thuva4 <tharma.thuva@gmail.com>
-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 |