Skip to content
This repository has been archived by the owner on Dec 11, 2021. It is now read-only.

Commit

Permalink
Fix tests to handle .jfifs being generated.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Ferrier committed Sep 6, 2020
1 parent 49ad58d commit 5dbebcb
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/Direct/test_Direct_CID.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from email.mime.multipart import MIMEMultipart

import os
import glob

from tests.BaseTestClasses import Email2PDFTestCase

Expand Down Expand Up @@ -261,11 +262,12 @@ def test_some_cids_not_referenced(self):
self.assertEqual('', error)
self.assertTrue(self.existsByTime())
self.assertLess(Email2PDFTestCase.JPG_SIZE, os.path.getsize(self.getTimedFilename()))
self.assertFalse(os.path.exists(os.path.join(self.workingDir, 'myid.jpg')))
self.assertTrue(os.path.exists(os.path.join(self.workingDir, 'myid2.jpg')))
self.assertTrue(os.path.exists(os.path.join(self.workingDir, 'myid3.jpg')))
self.assertTrue(os.path.exists(os.path.join(self.workingDir, 'floating_attachment.jpg')))
self.assertTrue(os.path.exists(os.path.join(self.workingDir, 'floating_attachment_1.jpg')))
# These use globs because they might generate .jpg or they might generate .jfif
self.assertFalse(glob.glob(os.path.join(self.workingDir, 'myid.*')))
self.assertTrue(glob.glob(os.path.join(self.workingDir, 'myid2.*')))
self.assertTrue(glob.glob(os.path.join(self.workingDir, 'myid3.*')))
self.assertTrue(glob.glob(os.path.join(self.workingDir, 'floating_attachment.*')))
self.assertTrue(glob.glob(os.path.join(self.workingDir, 'floating_attachment_1.*')))
self.assertFalse(self.existsByTimeWarning())
self.assertFalse(self.existsByTimeOriginal())

Expand Down

0 comments on commit 5dbebcb

Please sign in to comment.