def test_create_activity_exists(self, mCreateSession): iSession = MockSession() mCreateSession.return_value = (iSession, '123456') client = iSession.client('stepfunctions') activity = ActivityMixin() activity.arn = 'XXX' activity.create_activity() self.assertEqual(activity.arn, 'XXX') calls = [] self.assertEqual(client.mock_calls, calls)
def test_create_activity(self, mCreateSession): iSession = MockSession() mCreateSession.return_value = (iSession, '123456') client = iSession.client('stepfunctions') client.create_activity.return_value = {'activityArn': 'XXX'} activity = ActivityMixin() activity.name = 'name' self.assertEqual(activity.arn, None) activity.create_activity() self.assertEqual(activity.arn, 'XXX') calls = [mock.call.create_activity(name='name')] self.assertEqual(client.mock_calls, calls)