From 8dfef62db4392b3fded28eb4e706452a343a9a00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Sun, 25 Oct 2020 18:11:01 +0100 Subject: [PATCH] test_00_imaputil.py Runs fine MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch changes the bytes to strings in test_00 and now these tests run fine. Signed-off-by: Rodolfo García Peñas (kix) --- test/tests/test_00_imaputil.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/test/tests/test_00_imaputil.py b/test/tests/test_00_imaputil.py index c5924c3..c5dbc5d 100644 --- a/test/tests/test_00_imaputil.py +++ b/test/tests/test_00_imaputil.py @@ -58,39 +58,39 @@ class TestInternalFunctions(unittest.TestCase): def test_01_imapsplit(self): """Test imaputil.imapsplit()""" - res = imaputil.imapsplit(b'(\\HasNoChildren) "." "INBOX.Sent"') - self.assertEqual(res, [b'(\\HasNoChildren)', b'"."', b'"INBOX.Sent"']) + res = imaputil.imapsplit('(\\HasNoChildren) "." "INBOX.Sent"') + self.assertEqual(res, ['(\\HasNoChildren)', '"."', '"INBOX.Sent"']) - res = imaputil.imapsplit(b'"mo\\" o" sdfsdf') - self.assertEqual(res, [b'"mo\\" o"', b'sdfsdf']) + res = imaputil.imapsplit('"mo\\" o" sdfsdf') + self.assertEqual(res, ['"mo\\" o"', 'sdfsdf']) def test_02_flagsplit(self): """Test imaputil.flagsplit()""" - res = imaputil.flagsplit(b'(\\Draft \\Deleted)') - self.assertEqual(res, [b'\\Draft', b'\\Deleted']) + res = imaputil.flagsplit('(\\Draft \\Deleted)') + self.assertEqual(res, ['\\Draft', '\\Deleted']) - res = imaputil.flagsplit(b'(FLAGS (\\Seen Old) UID 4807)') - self.assertEqual(res, [b'FLAGS', b'(\\Seen Old)', b'UID', b'4807']) + res = imaputil.flagsplit('(FLAGS (\\Seen Old) UID 4807)') + self.assertEqual(res, ['FLAGS', '(\\Seen Old)', 'UID', '4807']) def test_04_flags2hash(self): """Test imaputil.flags2hash()""" - res = imaputil.flags2hash(b'(FLAGS (\\Seen Old) UID 4807)') - self.assertEqual(res, {b'FLAGS': b'(\\Seen Old)', b'UID': b'4807'}) + res = imaputil.flags2hash('(FLAGS (\\Seen Old) UID 4807)') + self.assertEqual(res, {'FLAGS': '(\\Seen Old)', 'UID': '4807'}) def test_05_flagsimap2maildir(self): """Test imaputil.flagsimap2maildir()""" - res = imaputil.flagsimap2maildir(b'(\\Draft \\Deleted)') - self.assertEqual(res, set(b'DT')) + res = imaputil.flagsimap2maildir('(\\Draft \\Deleted)') + self.assertEqual(res, set('DT')) def test_06_flagsmaildir2imap(self): """Test imaputil.flagsmaildir2imap()""" - res = imaputil.flagsmaildir2imap(set(b'DR')) - self.assertEqual(res, b'(\\Answered \\Draft)') + res = imaputil.flagsmaildir2imap(set('DR')) + self.assertEqual(res, '(\\Answered \\Draft)') # test all possible flags - res = imaputil.flagsmaildir2imap(set(b'SRFTD')) - self.assertEqual(res, b'(\\Answered \\Deleted \\Draft \\Flagged \\Seen)') + res = imaputil.flagsmaildir2imap(set('SRFTD')) + self.assertEqual(res, '(\\Answered \\Deleted \\Draft \\Flagged \\Seen)') def test_07_uid_sequence(self): """Test imaputil.uid_sequence()""" res = imaputil.uid_sequence([1, 2, 3, 4, 5, 10, 12, 13]) - self.assertEqual(res, b'1:5,10,12:13') + self.assertEqual(res, '1:5,10,12:13')