diff options
author | thuva4 <tharma.thuva@gmail.com> | 2018-05-10 19:35:34 +0530 |
---|---|---|
committer | thuva4 <tharma.thuva@gmail.com> | 2018-05-10 19:35:34 +0530 |
commit | 9218a48028db824204cf2708c3aee8f820d433d3 (patch) | |
tree | b2c131f2a3c4ced37cf4bcc775946678905b90fe /testapi/testapi-client/testapiclient/client | |
parent | beddc3a7a55a80479dca08d987ad8ac02c6e5dea (diff) |
Add deploy results client
Change-Id: I1f4cb33ce80318cdf532ce0dcb0665d890de1545
Signed-off-by: thuva4 <tharma.thuva@gmail.com>
Diffstat (limited to 'testapi/testapi-client/testapiclient/client')
-rw-r--r-- | testapi/testapi-client/testapiclient/client/deploy_results.py | 28 |
1 files changed, 28 insertions, 0 deletions
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))) |