Пример #1
0
def _process_mail_list(uri, runtime_storage_inst, record_processor_inst):
    LOG.info("Processing mail list %s" % uri)
    mail_iterator = mls.log(uri, runtime_storage_inst)
    mail_iterator_typed = _record_typer(mail_iterator, 'email')
    processed_mail_iterator = record_processor_inst.process(
        mail_iterator_typed)
    runtime_storage_inst.set_records(processed_mail_iterator)
Пример #2
0
    def test_log(self, mock_uri_content_changed, mock_get_mail_archive_links,
                 mock_read_gzip_from_uri):
        mock_uri_content_changed.return_value = True
        mock_get_mail_archive_links.return_value = ['link']
        mock_read_gzip_from_uri.return_value = EMAIL_CONTENT
        mock_rsi = mock.Mock()

        emails = list(mls.log('uri', mock_rsi))

        self.assertEqual(1, len(emails))
        self.assertEqual('Good morning Gary!\n\ntest works :)\n',
                         emails[0]['body'])
Пример #3
0
    def test_log(self, mock_uri_content_changed, mock_get_mail_archive_links,
                 mock_read_gzip_from_uri):
        mock_uri_content_changed.return_value = True
        mock_get_mail_archive_links.return_value = ['link']
        mock_read_gzip_from_uri.return_value = EMAIL_CONTENT
        mock_rsi = mock.Mock()

        emails = list(mls.log('uri', mock_rsi))

        self.assertEqual(1, len(emails))
        self.assertEqual('Good morning Gary!\n\ntest works :)\n',
                         emails[0]['body'])
Пример #4
0
def _process_mail_list(uri, runtime_storage_inst, record_processor_inst):
    mail_iterator = mls.log(uri, runtime_storage_inst)
    mail_iterator_typed = _record_typer(mail_iterator, 'email')
    processed_mail_iterator = record_processor_inst.process(
        mail_iterator_typed)
    runtime_storage_inst.set_records(processed_mail_iterator)
Пример #5
0
def process_mail_list(uri, runtime_storage_inst, record_processor_inst):
    mail_iterator = mls.log(uri, runtime_storage_inst)
    mail_iterator_typed = _record_typer(mail_iterator, 'email')
    processed_mail_iterator = record_processor_inst.process(
        mail_iterator_typed)
    runtime_storage_inst.set_records(processed_mail_iterator)