Esempio n. 1
0
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)
Esempio n. 2
0
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)
Esempio n. 3
0
    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)
Esempio n. 4
0
    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)