Beispiel #1
0
class TestEmailParser(TestCase):
    def setUp(self):
        email_text = open(sample_email).read() % 'someuuid'
        self.parser = CommEmailParser(email_text)

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

    def test_body(self):
        eq_(self.parser.get_body(), 'This is the body')
Beispiel #2
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')
Beispiel #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')
Beispiel #4
0
class TestEmailParser(TestCase):

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

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

    def test_body(self):
        eq_(self.parser.get_body(), 'This is the body')
Beispiel #5
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')
Beispiel #6
0
 def setUp(self):
     email_text = open(sample_email).read()
     self.parser = CommEmailParser(email_text)
Beispiel #7
0
 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')