Exemplo n.º 1
0
 def setUp(self):
     self.options = {
         'exporter_options': {
             'LOG_LEVEL':
             'DEBUG',
             'LOGGER_NAME':
             'export-pipeline',
             'notifications': [{
                 'name':
                 'exporters.notifications.s3_mail_notifier.SESMailNotifier',
                 'options': {
                     'team_mails': ['*****@*****.**'],
                     'client_mails': ['*****@*****.**'],
                     'access_key': 'somelogin',
                     'secret_key': 'somekey',
                     'mail_from': _MAIL_FROM,
                 }
             }]
         },
         'writer': {
             'name': 'somewriter',
             'options': {
                 'some_option': 'some_value',
                 'bucket': 'SOMEBUCKET',
                 'filebase': 'FILEBASE',
             }
         }
     }
     self.meta = ExportMeta(self.options)
     self.meta.per_module['writer']['items_count'] = 2
     self.notifier = SESMailNotifier(
         self.options['exporter_options']['notifications'][0], self.meta)
Exemplo n.º 2
0
 def test_invalid_mails(self):
     options = {
         'exporter_options': {
             'LOG_LEVEL':
             'DEBUG',
             'LOGGER_NAME':
             'export-pipeline',
             'notifications': [{
                 'name':
                 'exporters.notifications.s3_mail_notifier.S3MailNotifier',
                 'options': {
                     'team_mails': ['badmail'],
                     'client_mails': [],
                     'access_key': 'somelogin',
                     'secret_key': 'somekey',
                     'mail_from': _MAIL_FROM,
                 }
             }]
         },
         'writer': {
             'name': 'somewriter',
             'options': {
                 'some_option': 'some_value'
             }
         }
     }
     with self.assertRaises(InvalidMailProvided):
         SESMailNotifier(options['exporter_options']['notifications'][0],
                         {})