def __init__(self, query): self.query = query self.filterObject = None self.crawlerObject = None self.fileHandler = fsh.FileSystemHandler()
def testInit(self): f = fsh.FileSystemHandler() self.assertTrue(os.path.isdir(f.getRootDirectory()))
def __init__(self, query): self.query = query self.handler = fsh.FileSystemHandler() self.rootDirectory = self.handler.getRootDirectory()
def testDeleteSessionTempFiles(self): f = fsh.FileSystemHandler() dataDir = f.getRootDirectory() f.deleteSessionTempFiles(dataDir) self.assertFalse(os.path.isdir(dataDir + f.getSlashForOsVersion() + "testIfMkDir"))
def testGetSearchFilePath(self): f = fsh.FileSystemHandler() subdir, filename = "c++", "vector.txt" filePath = f.getRootDirectory() + f.getSlashForOsVersion() + subdir + f.getSlashForOsVersion() + filename self.assertEqual(f.getSearchFilePath(subdir, filename), filePath)
def testCheckDirElseMkDir(self): f = fsh.FileSystemHandler() testFolder = f.getRootDirectory() + f.getSlashForOsVersion() + "testIfMkDir" f.checkDirElseMkDir(testFolder) self.assertTrue(os.path.isdir(testFolder))
def testGetSlashForOsVersion(self): f = fsh.FileSystemHandler() self.assertEqual(f.getSlashForOsVersion(), "/")
def testGetRootDirectory(self): rootDir = "/home/philipp/Dokumente/5. Semester/Softwarepraktikum_Chatbot/chatbot-alpha/chatbot-alpha-001/tests/data" f = fsh.FileSystemHandler() self.assertEqual(f.getRootDirectory(), rootDir)