Skip to content

Commit db9e10e

Browse files
author
Drew Ayling
authored
fix move_cases_to_section (#84)
1 parent 3c98419 commit db9e10e

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

testrail_api/_category.py

+12-5
Original file line numberDiff line numberDiff line change
@@ -492,18 +492,25 @@ def copy_cases_to_section(self, section_id: int, case_ids: List[int]):
492492
json={"case_ids": ",".join(map(str, case_ids))},
493493
)
494494

495-
def move_cases_to_section(self, section_or_suite_id: int, case_ids: List[str]):
495+
def move_cases_to_section(
496+
self, section_id: int, suite_id: int, case_ids: List[str]
497+
):
496498
"""
497499
Moves cases to another suite or section.
498500
499-
:param section_or_suite_id: int
500-
The ID of the section or suite the case will be moved to.
501+
:param section_id: int
502+
The ID of the section the cases will be moved to.
503+
:param suite_id: int
504+
The ID of the suite for the section the cases will be moved to.
501505
:param case_ids:
502506
List of case IDs.
503507
"""
504508
return self.s.post(
505-
endpoint=f"move_cases_to_section/{section_or_suite_id}",
506-
json={"case_ids": ",".join(map(str, case_ids))},
509+
endpoint=f"move_cases_to_section/{section_id}",
510+
json={
511+
"case_ids": ",".join(map(str, case_ids)),
512+
"suite_id": suite_id,
513+
},
507514
)
508515

509516

tests/test_cases.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -193,5 +193,6 @@ def test_move_cases_to_section(api, mock, url):
193193
mock.add_callback(
194194
responses.POST, url("move_cases_to_section/5"), lambda x: (200, {}, x.body)
195195
)
196-
resp = api.cases.move_cases_to_section(section_or_suite_id=5, case_ids=[1, 2, 3])
196+
resp = api.cases.move_cases_to_section(5, 6, case_ids=[1, 2, 3])
197197
assert resp["case_ids"] == "1,2,3"
198+
assert resp["suite_id"] == 6

0 commit comments

Comments
 (0)