Add missing From/To header test for coverage.

This commit is contained in:
Andrew Ferrier 2015-11-02 09:23:56 +00:00
parent 9b2e293b34
commit 6604f6938d

View file

@ -19,6 +19,15 @@ class Direct_Basic(BaseTestClasses.Email2PDFTestCase):
self.assertFalse(self.existsByTimeWarning())
self.assertFalse(self.existsByTimeOriginal())
def test_missing_from_to(self):
path = os.path.join(self.examineDir, "missing_from_to.pdf")
self.addHeaders(frm=None, to=None)
error = self.invokeDirectly(outputFile=path, extraParams=['--headers'])
self.assertTrue(os.path.exists(path))
self.assertEqual('', error)
self.assertFalse(self.existsByTimeWarning())
self.assertFalse(self.existsByTimeOriginal())
def test_internationalised_subject(self):
path = os.path.join(self.examineDir, "internationalised_subject.pdf")
self.addHeaders(subject=bytes("Hello!", 'iso-8859-1'), subject_encoding='iso-8859-1')