Example #1
0
    def test_add_event_source(self, session):

        event_source = {
            'arn': 'blah:blah:blah:blah',
            'events': ["s3:ObjectCreated:*"]
        }
        # Sanity. This should fail.
        try:
            es = add_event_source(event_source, 'blah:blah:blah:blah',
                                  'test_settings.callback', session)
            self.fail("Success should have failed.")
        except ValueError:
            pass

        event_source = {'arn': 's3:s3:s3:s3', 'events': ["s3:ObjectCreated:*"]}
        add_event_source(event_source,
                         'lambda:lambda:lambda:lambda',
                         'test_settings.callback',
                         session,
                         dry=True)
        remove_event_source(event_source,
                            'lambda:lambda:lambda:lambda',
                            'test_settings.callback',
                            session,
                            dry=True)
Example #2
0
    def test_add_event_source(self, session):

        event_source = {'arn': 'blah:blah:blah:blah', 'events': [
                    "s3:ObjectCreated:*"
                  ]}
        # Sanity. This should fail.
        try:
            es = add_event_source(event_source, 'blah:blah:blah:blah', 'test_settings.callback', session)
            self.fail("Success should have failed.")
        except ValueError:
            pass

        event_source = {'arn': 's3:s3:s3:s3', 'events': [
                    "s3:ObjectCreated:*"
                  ]}
        add_event_source(event_source, 'lambda:lambda:lambda:lambda', 'test_settings.callback', session, dry=True)
        remove_event_source(event_source, 'lambda:lambda:lambda:lambda', 'test_settings.callback', session, dry=True)