Exemplo n.º 1
0
    def test_with_attachments(self):
        for email in (attach_email, attach_email2):
            email = open(attach_email).read()
            payload = base64.standard_b64encode(email)
            parser = CommEmailParser(payload)

            body = parser.get_body()
            ok_('Body inspection' in body)
            eq_(parser.get_uuid(), 'abc123')
Exemplo n.º 2
0
    def test_with_attachments(self):
        for email in (attach_email, attach_email2):
            email = open(attach_email).read()
            payload = base64.standard_b64encode(email)
            parser = CommEmailParser(payload)

            body = parser.get_body()
            ok_('Body inspection' in body)
            eq_(parser.get_uuid(), 'abc123')
Exemplo n.º 3
0
class TestEmailParser(TestCase):
    def setUp(self):
        email_text = open(sample_email).read()
        self.parser = CommEmailParser(email_text)

    def test_uuid(self):
        eq_(self.parser.get_uuid(), '5a0b8a83d501412589cc5d562334b46b')

    def test_body(self):
        eq_(self.parser.get_body(), 'test note 5\n')

    def test_multipart(self):
        multipart_email = open(multi_email).read()
        payload = base64.standard_b64encode(multipart_email)
        parser = CommEmailParser(payload)
        eq_(parser.get_body(), 'this is the body text\n')
        eq_(parser.get_uuid(), 'abc123')
Exemplo n.º 4
0
class TestEmailParser(TestCase):

    def setUp(self):
        email_text = open(sample_email).read()
        self.parser = CommEmailParser(email_text)

    def test_uuid(self):
        eq_(self.parser.get_uuid(), '5a0b8a83d501412589cc5d562334b46b')

    def test_body(self):
        eq_(self.parser.get_body(), 'test note 5\n')

    def test_multipart(self):
        multipart_email = open(multi_email).read()
        payload = base64.standard_b64encode(multipart_email)
        parser = CommEmailParser(payload)
        eq_(parser.get_body(), 'this is the body text\n')
        eq_(parser.get_uuid(), 'abc123')
Exemplo n.º 5
0
 def test_multipart(self):
     email = open(multi_email).read()
     payload = base64.standard_b64encode(email)
     parser = CommEmailParser(payload)
     eq_(parser.get_body(), 'this is the body text\n')
     eq_(parser.get_uuid(), 'abc123')
Exemplo n.º 6
0
 def test_basic_email(self):
     email_text = open(sample_email).read()
     parser = CommEmailParser(email_text)
     eq_(parser.get_uuid(), '5a0b8a83d501412589cc5d562334b46b')
     eq_(parser.get_body(), 'test note 5\n')
Exemplo n.º 7
0
 def test_multipart(self):
     email = open(multi_email).read()
     payload = base64.standard_b64encode(email)
     parser = CommEmailParser(payload)
     eq_(parser.get_body(), 'this is the body text\n')
     eq_(parser.get_uuid(), 'abc123')
Exemplo n.º 8
0
 def test_basic_email(self):
     email_text = open(sample_email).read()
     parser = CommEmailParser(email_text)
     eq_(parser.get_uuid(), '5a0b8a83d501412589cc5d562334b46b')
     eq_(parser.get_body(), 'test note 5\n')