Skip to content

Commit 912715a

Browse files
authored
Add parameters for rerun in start_launch
1 parent 347606b commit 912715a

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

reportportal_client/service.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ def start_launch(self,
214214
description=None,
215215
attributes=None,
216216
mode=None,
217+
rerun=False,
218+
rerunOf=None,
217219
**kwargs):
218220
"""Start a new launch with the given parameters."""
219221
if attributes and isinstance(attributes, dict):
@@ -223,7 +225,9 @@ def start_launch(self,
223225
"description": description,
224226
"attributes": attributes,
225227
"startTime": start_time,
226-
"mode": mode
228+
"mode": mode,
229+
"rerun": rerun,
230+
"rerunOf": rerunOf
227231
}
228232
url = uri_join(self.base_url_v2, "launch")
229233
r = self.session.post(url=url, json=data, verify=self.verify_ssl)

tests/test_service.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,18 @@ def test_start_launch(self, mock_get, rp_service):
7575
launch_id = rp_service.start_launch('name', datetime.now().isoformat())
7676
assert launch_id == 111
7777

78+
@mock.patch('reportportal_client.service._get_data')
79+
def test_start_launch_with_rerun(self, mock_get, rp_service):
80+
"""Test start launch and sending request.
81+
82+
:param mock_get: Mocked _get_data() function
83+
:param rp_service: Pytest fixture
84+
"""
85+
mock_get.return_value = {'id': 111}
86+
launch_id = rp_service.start_launch('name', datetime.now().isoformat(),
87+
rerun=True, rerunOf="111")
88+
assert launch_id == 111
89+
7890
@mock.patch('reportportal_client.service._get_msg')
7991
def test_finish_launch(self, mock_get, rp_service):
8092
"""Test finish launch and sending request.

0 commit comments

Comments
 (0)