def go(filePath): """Returns file content with repaired relative paths""" fileContent = filer.read(filePath) relPathList = getRel.getRel (fileContent) fileNames = [relPath.split("/")[-1] for relPath in relPathList] color.blue("fileNames") print(fileNames) futherFolder = getFutherFolder_model.get(filePath) absFileNames = [recursiveSearch_model.find_files(futherFolder, fileName) for fileName in fileNames] color.blue("absFileNames") print(absFileNames) newRelPathList = [absRel.Rel(filePath, absPath) for absPath in absFileNames] # first found would be inserted fileContent = replacePath.go(relPathList, newRelPathList, fileContent) return fileContent
def test_testName(self): color.blue("test here baby") result = recursiveSearch_model.find_files('/Users/maks/Library/Application Support/Sublime Text 3/Packages/goodPath/forTest/a', 'package.json') print('++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++') # for i in result: self.assertEqual(result, '/Users/maks/Library/Application Support/Sublime Text 3/Packages/goodPath/forTest/a/package.json')