workflow_tests: fix new test action id computation (#88066)
gitea/wcs/pipeline/head This commit looks good
Details
gitea/wcs/pipeline/head This commit looks good
Details
This commit is contained in:
parent
4ea852afe8
commit
ad2e64880e
|
@ -129,6 +129,15 @@ def test_workflow_tests_action_not_configured(pub):
|
|||
mocked_perform.assert_called_once()
|
||||
|
||||
|
||||
def test_workflow_tests_new_action_id(pub):
|
||||
wf_tests = workflow_tests.WorkflowTests()
|
||||
|
||||
for i in range(15):
|
||||
wf_tests.add_action(workflow_tests.ButtonClick)
|
||||
|
||||
assert [x.id for x in wf_tests.actions] == [str(i) for i in range(1, 16)]
|
||||
|
||||
|
||||
def test_workflow_tests_button_click(pub):
|
||||
role = pub.role_class(name='test role')
|
||||
role.store()
|
||||
|
|
|
@ -109,7 +109,7 @@ class WorkflowTests(XmlStorableObject):
|
|||
if not self.actions:
|
||||
return '1'
|
||||
|
||||
return str(int(max(x.id for x in self.actions)) + 1)
|
||||
return str(max(int(x.id) for x in self.actions) + 1)
|
||||
|
||||
def add_action(self, action_class):
|
||||
action = action_class(id=self.get_new_action_id())
|
||||
|
|
Loading…
Reference in New Issue