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')
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')
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')
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')