def test_folders(self): """Tests that the folders function returns the correct list.""" folders = list(maildir.folders(root=self.root)) self.assertEquals(len(folders), 3) self.assertIn("INBOX", folders) self.assertIn("INBOX.subdir", folders) self.assertIn("disconnected.folder", folders) self.assertNotIn("not_a_folder", folders) self.assertNotIn("broken_maildir", folders)
def test_folders_invalid(self): """Tests that the folders function returns nothing for invalid Maildirs.""" folders = list(maildir.folders(root=self.invalid_dir)) self.assertEquals(folders, [])