(self)
| 844 | self.assertEqual(sorted(self._box._toc.keys()), sorted([key0, key1])) |
| 845 | |
| 846 | def test_lookup(self): |
| 847 | # Look up message subpaths in the TOC |
| 848 | self.assertRaises(KeyError, lambda: self._box._lookup('foo')) |
| 849 | key0 = self._box.add(self._template % 0) |
| 850 | self.assertEqual(self._box._lookup(key0), os.path.join('new', key0)) |
| 851 | os.remove(os.path.join(self._path, 'new', key0)) |
| 852 | self.assertEqual(self._box._toc, {key0: os.path.join('new', key0)}) |
| 853 | # Be sure that the TOC is read back from disk (see issue #6896 |
| 854 | # about bad mtime behaviour on some systems). |
| 855 | self._box.flush() |
| 856 | self.assertRaises(KeyError, lambda: self._box._lookup(key0)) |
| 857 | self.assertEqual(self._box._toc, {}) |
| 858 | |
| 859 | def test_lock_unlock(self): |
| 860 | # Lock and unlock the mailbox. For Maildir, this does nothing. |
nothing calls this directly
no test coverage detected