tests.30_libs.040_FileSysObjects.100_createAndUseSearchLists package¶
Submodules¶
tests.30_libs.040_FileSysObjects.100_createAndUseSearchLists.CallCase module¶
Create a plist, find a matching relative filepathname in directory tree.
Calling elementary functions.
Data:
see 'testdata.examples'
Call:
import testdata import filesysobjects.FileSysObjects s = os.sep any_sub_path = os.path.normpath('a/b0/c/d/D.txt') spath = testdata.mypath spath += any_sub_path # Here an empty list is used for search only. The function adds # entries to the provided list storage, thus e.g. to 'sys.path' too. _plist = [] setUpperTreeSearchPath(spath,os.path.normpath('b/B.txt'), _plist) rp = findRelPathInSearchPath(spath,_plist)
Result:
expected = os.path.normpath(testdata.mypath +s+ 'a/b/B.txt')