summaryrefslogtreecommitdiff
path: root/tests/db
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2018-12-04 22:15:26 +0000
committerPatrick Totzke <patricktotzke@gmail.com>2018-12-07 20:13:38 +0000
commitea48518c0013695f243ad437561124b67a5bc6c9 (patch)
tree4ae627b787fb63fda4329c30b1f1cfc61d74485d /tests/db
parent176cffcd8f8c7a7a6b7367781f1e7a7c5ebc9976 (diff)
tests: update test_malformed_cte_value
It now tests if malformed Content-Transfer-Encoding values are reported in the logs
Diffstat (limited to 'tests/db')
-rw-r--r--tests/db/utils_test.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/db/utils_test.py b/tests/db/utils_test.py
index 964cc3d4..160ef453 100644
--- a/tests/db/utils_test.py
+++ b/tests/db/utils_test.py
@@ -743,6 +743,10 @@ class TestRemoveCte(unittest.TestCase):
def test_malformed_cte_value(self):
with open('tests/static/mail/malformed-header-CTE.eml') as fp:
mail = email.message_from_file(fp)
- with self.assertRaisesRegex(ValueError,
- "Unknown Content-Transfer-Encoding"):
+
+ with self.assertLogs(level='INFO') as cm: # keep logs
utils.remove_cte(mail, as_string=True)
+
+ # We expect no Exceptions but a complaint in the log
+ logmsg = 'INFO:root:Unknown Content-Transfer-Encoding: "7bit;"'
+ self.assertEqual(cm.output, [logmsg])