Skip to content

Commit

Permalink
108 Get Test Case Statuses
Browse files Browse the repository at this point in the history
  • Loading branch information
tolstislon committed Jul 15, 2024
1 parent ded1e48 commit cd487b9
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
8 changes: 8 additions & 0 deletions testrail_api/_category.py
Original file line number Diff line number Diff line change
Expand Up @@ -1905,6 +1905,14 @@ def get_statuses(self) -> List[dict]:
"""
return self.s.get(endpoint="get_statuses")

def get_case_statuses(self) -> List[dict]:
"""
Returns a list of available test case statuses
:return: response
"""
return self.s.get(endpoint="get_case_statuses")


class Suites(_MetaCategory):
"""https://www.gurock.com/testrail/docs/api/reference/suites"""
Expand Down
28 changes: 28 additions & 0 deletions tests/test_statuses.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,31 @@ def test_get_statuses(api, mock, url):
resp = api.statuses.get_statuses()
assert resp[0]['id'] == 1
assert resp[1]['label'] == 'Failed'


def test_get_case_statuses(api, mock, url):
mock.add_callback(
responses.GET,
url('get_case_statuses'),
lambda x: (200, {}, json.dumps(
[
{
"case_status_id": 1,
"name": "Approved",
"abbreviation": None,
"is_default": False,
"is_approved": True
},
{
"case_status_id": 2,
"name": "Draft",
"abbreviation": None,
"is_default": True,
"is_approved": True
}
]
))
)
resp = api.statuses.get_case_statuses()
assert resp[0]['case_status_id'] == 1
assert resp[1]['name'] == 'Draft'

0 comments on commit cd487b9

Please sign in to comment.