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