Commit 4d08ef2f authored by Laurent Peuch's avatar Laurent Peuch
Browse files

chore: convert test/test_umessage.py to utf-8 because it's 2021

parent 46b8ef8b2454
# encoding: iso-8859-15
# encoding: utf-8
# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
......@@ -42,12 +42,12 @@ class UMessageTC(TestCase):
def test_get_subject(self):
subj = self.umessage2.get("Subject")
self.assertEqual(type(subj), str)
self.assertEqual(subj, " LA MER")
self.assertEqual(subj, "À LA MER")
def test_get_all(self):
to = self.umessage2.get_all("To")
self.assertEqual(type(to[0]), str)
self.assertEqual(to, ["lment accents <alf@logilab.fr>"])
self.assertEqual(to, ["élément à accents <alf@logilab.fr>"])
def test_get_payload_no_multi(self):
payload = self.umessage1.get_payload()
......@@ -68,19 +68,19 @@ Date: now
dW4gcGV0aXQgY8O2dWNvdQ==
"""
msg = message_from_string(msg)
self.assertEqual(msg.get_payload(decode=True), "un petit cucou")
self.assertEqual(msg.get_payload(decode=True), "un petit cöucou")
def test_decode_QP(self):
test_line = "=??b?UmFwaGHrbA==?= DUPONT<raphael.dupont@societe.fr>"
test = decode_QP(test_line)
self.assertEqual(type(test), str)
self.assertEqual(test, "Raphal DUPONT<raphael.dupont@societe.fr>")
self.assertEqual(test, "Raphaël DUPONT<raphael.dupont@societe.fr>")
def test_decode_QP_utf8(self):
test_line = "=?utf-8?q?o=C3=AEm?= <oim@logilab.fr>"
test = decode_QP(test_line)
self.assertEqual(type(test), str)
self.assertEqual(test, "om <oim@logilab.fr>")
self.assertEqual(test, "oîm <oim@logilab.fr>")
def test_decode_QP_ascii(self):
test_line = "test <test@logilab.fr>"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment