diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2023-12-26 11:15:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-26 11:15:14 +0200 |
commit | e87cadc1ce194aae2c076e81298d6e8074f1bb45 (patch) | |
tree | 3cdba116c8e0f1aa0b93e41270968e932f4846f3 /Lib/test | |
parent | b5dc0f83adda0bde1b176c3a84cc31cd94254e73 (diff) | |
download | cpython-e87cadc1ce194aae2c076e81298d6e8074f1bb45.tar.gz cpython-e87cadc1ce194aae2c076e81298d6e8074f1bb45.zip |
gh-66515: mailbox.MH now supports folders withou the ".mh_sequences" file (GH-804)
(for example Claws Mail IMAP-cache folders).
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_mailbox.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py index caa7eb3d829..8c350eb02cc 100644 --- a/Lib/test/test_mailbox.py +++ b/Lib/test/test_mailbox.py @@ -1347,6 +1347,19 @@ class TestMH(TestMailbox, unittest.TestCase): self._box.remove(key1) self.assertEqual(self._box.get_sequences(), {'flagged':[key0]}) + self._box.set_sequences({'foo':[key0]}) + self.assertEqual(self._box.get_sequences(), {'foo':[key0]}) + + def test_no_dot_mh_sequences_file(self): + path = os.path.join(self._path, 'foo.bar') + os.mkdir(path) + box = self._factory(path) + self.assertEqual(os.listdir(path), []) + self.assertEqual(box.get_sequences(), {}) + self.assertEqual(os.listdir(path), []) + box.set_sequences({}) + self.assertEqual(os.listdir(path), ['.mh_sequences']) + def test_issue2625(self): msg0 = mailbox.MHMessage(self._template % 0) msg0.add_sequence('foo') |