From e6b38b2f74bc3bd6b2e60764a2c6f96ee0849120 Mon Sep 17 00:00:00 2001 From: Kurt Sansom Date: Thu, 19 May 2022 13:18:22 -0500 Subject: [PATCH 1/2] feat: get test run details add get_test_run method to get the test run details --- py_jama_rest_client/client.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/py_jama_rest_client/client.py b/py_jama_rest_client/client.py index 4c0a953..3265728 100644 --- a/py_jama_rest_client/client.py +++ b/py_jama_rest_client/client.py @@ -764,6 +764,20 @@ def get_testruns(self, test_cycle_id, allowed_results_per_page=__allowed_results testrun_data = self.__get_all(resource_path, allowed_results_per_page=allowed_results_per_page) return testrun_data + def get_test_run(self, test_run_id): + """This method will get a test run details from Jama through the API + Args: + test_run_id: the api id of the test run + """ + resource_path = 'testruns/' + str(test_run_id) + try: + response = self.__core.get(resource_path) + except CoreException as err: + py_jama_rest_client_logger.error(err) + raise APIException(str(err)) + JamaClient.__handle_response_status(response) + return response.json()['data'] + def get_items_upstream_relationships(self, item_id, allowed_results_per_page=__allowed_results_per_page): """ Returns a list of all the upstream relationships for the item with the specified ID. From 284ad55b8abfb4974cbc4252191a85606b7c9cff Mon Sep 17 00:00:00 2001 From: "Sansom, Kurt" Date: Fri, 7 Jun 2024 09:40:05 -0500 Subject: [PATCH 2/2] fix: add get test run lock status --- py_jama_rest_client/client.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/py_jama_rest_client/client.py b/py_jama_rest_client/client.py index 3265728..7aa1cb6 100644 --- a/py_jama_rest_client/client.py +++ b/py_jama_rest_client/client.py @@ -764,7 +764,7 @@ def get_testruns(self, test_cycle_id, allowed_results_per_page=__allowed_results testrun_data = self.__get_all(resource_path, allowed_results_per_page=allowed_results_per_page) return testrun_data - def get_test_run(self, test_run_id): + def get_testrun(self, test_run_id): """This method will get a test run details from Jama through the API Args: test_run_id: the api id of the test run @@ -778,6 +778,20 @@ def get_test_run(self, test_run_id): JamaClient.__handle_response_status(response) return response.json()['data'] + def get_testrun_lock(self, test_run_id): + """This method will return a single test run lock status. + Args: + test_run_id: the api id of the test run + """ + resource_path = 'testruns/' + str(test_run_id) + '/lock' + try: + response = self.__core.get(resource_path) + except CoreException as err: + py_jama_rest_client_logger.error(err) + raise APIException(str(err)) + JamaClient.__handle_response_status(response) + return response.json()['data'] + def get_items_upstream_relationships(self, item_id, allowed_results_per_page=__allowed_results_per_page): """ Returns a list of all the upstream relationships for the item with the specified ID.