class TestMaildirDriver(unittest.TestCase): def setUp(self): self.driverA, self.driverB = Maildir(), Maildir() confBase = { 'sep': '/' } confA, confB = confBase.copy(), confBase.copy() confA['path'] = os.path.join(libcore.testingPath(), 'maildirs', 'recursive_A') confB['path'] = os.path.join(libcore.testingPath(), 'maildirs', 'recursive_B') self.driverA.fw_init(NullUI(), confA, self.driverA) self.driverB.fw_init(NullUI(), confB, self.driverB) def test_getFolders_of_recursive_A(self): folders = self.driverA.getFolders() expected = Folders(Folder(b'/')) self.assertEqual(folders, expected) def test_getFolders_of_recursive_B(self): folders = self.driverB.getFolders() expected = Folders( Folder(b'/'), Folder(b'subfolder_A'), Folder(b'subfolder_B'), Folder(b'subfolder_B/subsubfolder_X'), ) self.assertEqual(folders, expected)
class TestMaildirDriver(unittest.TestCase): def setUp(self): self.driverA, self.driverB = Maildir(), Maildir() confBase = {'sep': '/'} confA, confB = confBase.copy(), confBase.copy() confA['path'] = os.path.join(libcore.testingPath(), 'maildirs', 'recursive_A') confB['path'] = os.path.join(libcore.testingPath(), 'maildirs', 'recursive_B') self.driverA.fw_init(NullUI(), confA, self.driverA) self.driverB.fw_init(NullUI(), confB, self.driverB) def test_getFolders_of_recursive_A(self): folders = self.driverA.getFolders() expected = Folders(Folder(b'/')) self.assertEqual(folders, expected) def test_getFolders_of_recursive_B(self): folders = self.driverB.getFolders() expected = Folders( Folder(b'/'), Folder(b'subfolder_A'), Folder(b'subfolder_B'), Folder(b'subfolder_B/subsubfolder_X'), ) self.assertEqual(folders, expected)
def setUp(self): self.driverA, self.driverB = Maildir(), Maildir() confBase = {'sep': '/'} confA, confB = confBase.copy(), confBase.copy() confA['path'] = os.path.join(libcore.testingPath(), 'maildirs', 'recursive_A') confB['path'] = os.path.join(libcore.testingPath(), 'maildirs', 'recursive_B') self.driverA.fw_init(NullUI(), confA, self.driverA) self.driverB.fw_init(NullUI(), confB, self.driverB)
def setUp(self): self.driverA, self.driverB = Maildir(), Maildir() confBase = { 'sep': '/' } confA, confB = confBase.copy(), confBase.copy() confA['path'] = os.path.join(libcore.testingPath(), 'maildirs', 'recursive_A') confB['path'] = os.path.join(libcore.testingPath(), 'maildirs', 'recursive_B') self.driverA.fw_init(NullUI(), confA, self.driverA) self.driverB.fw_init(NullUI(), confB, self.driverB)