From a2a855bc1b66284addaead40b23f43a574de336d Mon Sep 17 00:00:00 2001 From: thuva4 Date: Sat, 5 May 2018 12:49:16 +0530 Subject: Add result model to the client Change-Id: I0921835f8d1042b2d0c12f3972bda24736741d55 Signed-off-by: thuva4 --- testapi/testapi-client/testapiclient/cli/results.py | 9 +++------ testapi/testapi-client/testapiclient/models/result.py | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 6 deletions(-) create mode 100644 testapi/testapi-client/testapiclient/models/result.py 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 -- cgit 1.2.3-korg