Skip to content

Commit

Permalink
remove deprecated methods from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
essweine committed Nov 1, 2023
1 parent c41e949 commit c4e7f90
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 31 deletions.
8 changes: 4 additions & 4 deletions tests/SpiffWorkflow/bpmn/CallActivityTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ def test_call_activity_allows_removal_of_data(self):
self.assertTrue(self.workflow.is_completed())
self.assertNotIn('remove_this_var', self.workflow.last_task.data.keys())

def test_call_acitivity_errors_include_task_trace(self):
def test_call_activity_errors_include_task_trace(self):
error_spec = self.subprocesses.get('ErroringBPMN')
error_spec, subprocesses = self.load_workflow_spec('call_activity_*.bpmn', 'ErroringBPMN')
with self.assertRaises(WorkflowTaskException) as context:
self.workflow = BpmnWorkflow(error_spec, subprocesses)
self.workflow.do_engine_steps()
self.assertEquals(2, len(context.exception.task_trace))
self.assertRegexpMatches(context.exception.task_trace[0], 'Create Data \(.*?call_activity_call_activity.bpmn\)')
self.assertRegexpMatches(context.exception.task_trace[1], 'Get Data Call Activity \(.*?call_activity_with_error.bpmn\)')
self.assertEqual(2, len(context.exception.task_trace))
self.assertRegex(context.exception.task_trace[0], 'Create Data \(.*?call_activity_call_activity.bpmn\)')
self.assertRegex(context.exception.task_trace[1], 'Get Data Call Activity \(.*?call_activity_with_error.bpmn\)')
task = self.workflow.get_next_task(spec_name='Sub_Bpmn_Task')
self.assertEqual(task.state, TaskState.ERROR)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# -*- coding: utf-8 -*-

import unittest

from SpiffWorkflow.bpmn.workflow import BpmnWorkflow
from tests.SpiffWorkflow.bpmn.BpmnWorkflowTestCase import BpmnWorkflowTestCase

Expand All @@ -22,13 +18,8 @@ def testRunThroughHappy(self):
self.assertFalse(self.workflow.is_completed())
self.assertEqual(4, len(self.get_ready_user_tasks()))
tasks = self.get_ready_user_tasks()
self.assertEquals("Task 1", tasks[0].task_spec.bpmn_name)
self.assertEquals("Task 2", tasks[1].task_spec.bpmn_name)
self.assertEquals("Task 3", tasks[2].task_spec.bpmn_name)
self.assertEquals("Task 4", tasks[3].task_spec.bpmn_name)

self.assertEqual("Task 1", tasks[0].task_spec.bpmn_name)
self.assertEqual("Task 2", tasks[1].task_spec.bpmn_name)
self.assertEqual("Task 3", tasks[2].task_spec.bpmn_name)
self.assertEqual("Task 4", tasks[3].task_spec.bpmn_name)

def suite():
return unittest.TestLoader().loadTestsFromTestCase(ParallelOrderTest)
if __name__ == '__main__':
unittest.TextTestRunner(verbosity=2).run(suite())
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ def actual_test(self, save_restore=False):
task = self.get_ready_user_tasks()[0]
task.data = data
self.workflow.run_task_from_id(task.id)
self.assertEquals(total, len(self.workflow.get_tasks()))
self.assertEqual(total, len(self.workflow.get_tasks()))

# Reset the token to the first user task.
# We should still have the same number of tasks.
task.reset_branch(data)
self.assertEquals(total, len(self.workflow.get_tasks()))
self.assertEquals(1, len(self.get_ready_user_tasks()))
self.assertEqual(total, len(self.workflow.get_tasks()))
self.assertEqual(1, len(self.get_ready_user_tasks()))
9 changes: 0 additions & 9 deletions tests/SpiffWorkflow/camunda/UserTaskParserTest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import unittest

from tests.SpiffWorkflow.camunda.BaseTestCase import BaseTestCase


Expand Down Expand Up @@ -38,10 +36,3 @@ def testNoFormDoesNotBombOut(self):
def testCreateTask(self):
pass


def suite():
return unittest.TestLoader().loadTestsFromTestCase(UserTaskParserTest)


if __name__ == '__main__':
unittest.TextTestRunner(verbosity=2).run(suite())
4 changes: 2 additions & 2 deletions tests/SpiffWorkflow/camunda/specs/UserTaskSpecTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ def test_properties(self):
self.assertFalse(form_field.has_property("wilma"))
form_field.add_property("wilma", "flintstone")
self.assertTrue(form_field.has_property("wilma"))
self.assertEquals("flintstone", form_field.get_property("wilma"))
self.assertEqual("flintstone", form_field.get_property("wilma"))

def test_validations(self):
form_field = FormField(form_type="text")
self.assertFalse(form_field.has_validation("barney"))
form_field.add_validation("barney", "rubble")
self.assertTrue(form_field.has_validation("barney"))
self.assertEquals("rubble", form_field.get_validation("barney"))
self.assertEqual("rubble", form_field.get_validation("barney"))

def testIsEngineTask(self):
self.assertTrue(self.user_spec.manual)

0 comments on commit c4e7f90

Please sign in to comment.