From 9218a48028db824204cf2708c3aee8f820d433d3 Mon Sep 17 00:00:00 2001 From: thuva4 Date: Thu, 10 May 2018 19:35:34 +0530 Subject: Add deploy results client Change-Id: I1f4cb33ce80318cdf532ce0dcb0665d890de1545 Signed-off-by: thuva4 --- .../testapiclient/client/deploy_results.py | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 testapi/testapi-client/testapiclient/client/deploy_results.py (limited to 'testapi/testapi-client/testapiclient/client/deploy_results.py') diff --git a/testapi/testapi-client/testapiclient/client/deploy_results.py b/testapi/testapi-client/testapiclient/client/deploy_results.py new file mode 100644 index 0000000..b0724b0 --- /dev/null +++ b/testapi/testapi-client/testapiclient/client/deploy_results.py @@ -0,0 +1,28 @@ +import json + +from testapiclient.client import base +from testapiclient.utils import urlparse + + +class DeployResultsClient(base.Client): + resource = 'deployresults' + + def __init__(self, **kwargs): + super(DeployResultsClient, self).__init__(**kwargs) + + def create(self, testcase_req): + return self.clientmanager.post(self.url, testcase_req) + + def get(self, **queries): + if queries: + return json.dumps( + self.clientmanager.get( + urlparse.query_join(self.url, **queries))['deployresults']) + else: + return json.dumps( + self.clientmanager.get(self.url)['deployresults']) + + def get_one(self, id): + return json.dumps( + self.clientmanager.get( + urlparse.path_join(self.url, id))) -- cgit 1.2.3-korg