示例#1
0
    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)
示例#2
0
    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)