from unittest import TestCase, mock from slz_appreciationengine_scrapper.step_function_service import StepFunctionService # TODO: add tests using `localstack` class StepFunctionServiceTestCase(TestCase): def setUp(self): self.token = 'token' self.client = mock.Mock() self.service = StepFunctionService(mock.Mock(), self.client, self.token) def test_send(self): message = 'uow processed successfully' self.service.send_success(message) self.client.send_task_success.assert_called_once_with( taskToken=self.token, output=message, ) def test_seend_failure(self): error = 'uow processed successfully' cause = 'extra' self.service.send_failure(error, cause) self.client.send_task_failure.assert_called_once_with( taskToken=self.token, error=error, cause=cause, )