restore-mail-inject.py - Tool to inject mails via IMAP
Copyright (c) 2012 Intra2net AG
+Author: Plamen Dimitrov and Thomas Jarosch
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
'''
import unittest
# wrong naming conventions are due to python unittest library requirement
def tearDown(self):
+
"""Clean up the testing conditions"""
os.unlink(self.dummy_filename)
def test_mboxlist_firstline(self):
+
"""Test whether first line was parsed correctly."""
parsed_acls = self.file_iter.load_mailbox_list(self.dummy_filename)
self.assertIn("user.00schneider", parsed_acls)
self.assertEqual(parsed_acls["user.00schneider"]["00schneider"], "lrswipkxtecda", "Wront acls were parsed for a user.")
def test_mboxlist_totals(self):
+
"""Test whether there are missing parsed lines, mailboxs, and users."""
parsed_acls = self.file_iter.load_mailbox_list(self.dummy_filename)
self.assertEqual(len(parsed_acls), 12)