Skip to content

Commit e5bff44

Browse files
authored
added pagination to xray method for getting tests associated with test plan (#825)
1 parent 8ad2a19 commit e5bff44

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

atlassian/xray.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,14 +240,23 @@ def delete_test_from_test_set(self, test_set_key, test_key):
240240
return self.delete(url)
241241

242242
# Test Plans API
243-
def get_tests_with_test_plan(self, test_plan_key):
243+
def get_tests_with_test_plan(self, test_plan_key, limit=None, page=None):
244244
"""
245245
Retrieve the tests associated with the given test plan.
246246
:param test_plan_key: Test set key (eg. 'PLAN-001').
247+
:param limit: OPTIONAL: Limits the number of results per page.
248+
:param page: OPTIONAL: Number of the page to be returned.
247249
:return: Return a list of the test associated with the test plan.
248250
"""
249251
url = "rest/raven/1.0/api/testplan/{0}/test".format(test_plan_key)
250-
return self.get(url)
252+
params = {}
253+
254+
if limit:
255+
params["limit"] = limit
256+
if page:
257+
params["page"] = page
258+
259+
return self.get(url, params=params)
251260

252261
def update_test_plan(self, test_plan_key, add=None, remove=None):
253262
"""

0 commit comments

Comments
 (0)