예제 #1
0
    def testGetFolders_04(self):
        self.tempDirList.append(mkdtemp(prefix='Абырвалг spell 1'))
        self._createDict(self.tempDirList[0], "ru_RU")

        self.tempDirList.append(mkdtemp(prefix='Абырвалг spell 2'))
        self._createDict(self.tempDirList[1], "ru_RU")
        self._createDict(self.tempDirList[1], "en_US")

        finder = DictsFinder(self.tempDirList)
        self.assertEqual(finder.getFoldersForLang("ru_RU"),
                         [self.tempDirList[0], self.tempDirList[1]])
        self.assertEqual(finder.getFoldersForLang("en_US"),
                         [self.tempDirList[1]])
예제 #2
0
    def testGetFolders_04(self):
        self.tempDirList.append(mkdtemp(prefix='Абырвалг spell 1'))
        self._createDict(self.tempDirList[0], "ru_RU")

        self.tempDirList.append(mkdtemp(prefix='Абырвалг spell 2'))
        self._createDict(self.tempDirList[1], "ru_RU")
        self._createDict(self.tempDirList[1], "en_US")

        finder = DictsFinder(self.tempDirList)
        self.assertEqual(finder.getFoldersForLang("ru_RU"),
                         [self.tempDirList[0], self.tempDirList[1]])
        self.assertEqual(finder.getFoldersForLang("en_US"),
                         [self.tempDirList[1]])
예제 #3
0
    def testGetFolders_empty_03_invalid(self):
        self.tempDirList.append(mkdtemp(prefix='Абырвалг spell 1'))

        with open(os.path.join(self.tempDirList[0],
                               "ru_RU" + DictsFinder.dictExtensions[0]), "w"):
            pass

        finder = DictsFinder(self.tempDirList)
        self.assertEqual(finder.getFoldersForLang("ru_RU"), [])
예제 #4
0
    def testGetFolders_empty_03_invalid(self):
        self.tempDirList.append(mkdtemp(prefix='Абырвалг spell 1'))

        with open(
                os.path.join(self.tempDirList[0],
                             "ru_RU" + DictsFinder.dictExtensions[0]), "w"):
            pass

        finder = DictsFinder(self.tempDirList)
        self.assertEqual(finder.getFoldersForLang("ru_RU"), [])
예제 #5
0
    def testGetFolders_empty_02(self):
        self.tempDirList.append(mkdtemp(prefix='Абырвалг spell 1'))
        self.tempDirList.append(mkdtemp(prefix='Абырвалг spell 2'))

        finder = DictsFinder(self.tempDirList)
        self.assertEqual(finder.getFoldersForLang("ru_RU"), [])
예제 #6
0
 def testGetFolders_empty_01(self):
     finder = DictsFinder(self.tempDirList)
     self.assertEqual(finder.getFoldersForLang("ru_RU"), [])
예제 #7
0
    def testGetFolders_empty_02(self):
        self.tempDirList.append(mkdtemp(prefix='Абырвалг spell 1'))
        self.tempDirList.append(mkdtemp(prefix='Абырвалг spell 2'))

        finder = DictsFinder(self.tempDirList)
        self.assertEqual(finder.getFoldersForLang("ru_RU"), [])
예제 #8
0
 def testGetFolders_empty_01(self):
     finder = DictsFinder(self.tempDirList)
     self.assertEqual(finder.getFoldersForLang("ru_RU"), [])