Exemple #1
0
    def test_delete_activity(self, mCreateSession):
        iSession = MockSession()
        mCreateSession.return_value = (iSession, '123456')
        client = iSession.client('stepfunctions')

        activity = ActivityMixin()
        activity.arn = 'XXX'

        activity.delete_activity()

        self.assertEqual(activity.arn, None)

        calls = [mock.call.delete_activity(activityArn='XXX')]
        self.assertEqual(client.mock_calls, calls)
Exemple #2
0
    def test_delete_activity_exception(self, mCreateSession):
        iSession = MockSession()
        mCreateSession.return_value = (iSession, '123456')
        client = iSession.client('stepfunctions')

        activity = ActivityMixin()

        self.assertEqual(activity.arn, None)

        with self.assertRaises(Exception):
            activity.delete_activity(exception=True)

        self.assertEqual(activity.arn, None)

        calls = []
        self.assertEqual(client.mock_calls, calls)