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]])
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"), [])
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"), [])
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"), [])
def testGetFolders_empty_01(self): finder = DictsFinder(self.tempDirList) self.assertEqual(finder.getFoldersForLang("ru_RU"), [])