Example #1
0
    def test_heartbeat_no_token(self, mCreateSession):
        iSession = MockSession()
        mCreateSession.return_value = (iSession, '123456')

        task = TaskMixin()

        with self.assertRaises(Exception):
            task.heartbeat()
Example #2
0
    def test_heartbeat(self, mCreateSession):
        iSession = MockSession()
        client = iSession.client('stepfunctions')
        mCreateSession.return_value = (iSession, '123456')

        task = TaskMixin()
        task.token = 'token'
        task.heartbeat()

        call = mock.call.send_task_heartbeat(taskToken='token')
        self.assertEqual(client.mock_calls, [call])