def test_find_file_in_dirs(self): # Search for file `path` in the sequence of directories `dirs`. # Return the first expansion that matches an existing file. dirs = ('nonex', '.', '..') self.assertEqual(utils.find_file_in_dirs('HISTORY.txt', dirs), '../HISTORY.txt') # Return `path` if the file exists in the cwd or if there is no match self.assertEqual(utils.find_file_in_dirs('alltests.py', dirs), 'alltests.py') self.assertEqual(utils.find_file_in_dirs('gibts/nicht.txt', dirs), 'gibts/nicht.txt')
def test_find_file_in_dirs(self): # Search for file `path` in the sequence of directories `dirs`. # Return the first expansion that matches an existing file. dirs = ("nonex", ".", "..") found = utils.find_file_in_dirs("HISTORY.txt", dirs) # returns # '..\\HISTORY.txt' on windows # '../HISTORY.txt' on other platforms # 'HISTORY.txt' if not called from docutils directory. self.assertTrue(found.startswith("..")) # Return `path` if the file exists in the cwd or if there is no match self.assertEqual(utils.find_file_in_dirs("alltests.py", dirs), "alltests.py") self.assertEqual(utils.find_file_in_dirs("gibts/nicht.txt", dirs), "gibts/nicht.txt")
def test_find_file_in_dirs(self): # Search for file `path` in the sequence of directories `dirs`. # Return the first expansion that matches an existing file. dirs = ('nonex', '.', '..') found = utils.find_file_in_dirs('HISTORY.txt', dirs) # returns # '..\\HISTORY.txt' on windows # '../HISTORY.txt' on other platforms # 'HISTORY.txt' if not called from docutils directory. self.assertTrue(found.startswith('..')) # Return `path` if the file exists in the cwd or if there is no match self.assertEqual(utils.find_file_in_dirs('alltests.py', dirs), 'alltests.py') self.assertEqual(utils.find_file_in_dirs('gibts/nicht.txt', dirs), 'gibts/nicht.txt')