UseCases.FileSysObjects.branches.searchHookPointForSideBranchStr package¶
Submodules¶
UseCases.FileSysObjects.branches.searchHookPointForSideBranchStr.CallCase module¶
Create a plist, find single-node hooks for side branches in PATH strings.
The first match is used by default, e.g. the branch ‘a/new/branch’, maps the node and extends at ‘a/’
testdata.mypath+/examples/a/b0/c/a/b0/c __________________________a/ ____________________________`--new/branch
- resulting in:
testdata.mypath+'/examples/a/b0/c/a/new/branch'
Data:
see 'testdata.examples'
refer also to the manual [filesystem-elements-as-objects]
Call:
# 1. search and create a path for a side branch sp = os.path.normpath('a/new/branch') rp = getTopFromPathString(sp,self._plist) # 2. search and create a path for a side branch - use the second plist entry sp = os.path.normpath('c/new/branch') rp = getTopFromPathString(sp,self._plist,**{'matchidx':1}) # 3. search and create a path for a side branch - use the second plist entry + reverse the order sp = os.path.normpath('c/new/branch') rp = getTopFromPathString(sp,self._plist,**{'matchidx':1,'reverse':True,}) # 4. search and create a path for a side branch - match a path entry with and use the second match within a path entry sp = os.path.normpath('c/new/branch') rp = getTopFromPathString(sp,self._plist,**{'matchlvl':1,}) # 5. search and create a path for a side branch UPWARD - match a path entry with and use the second match within a path entry sp = os.path.normpath('c/new/branch') rp = getTopFromPathString(sp,self._plist,**{'matchlvlupward':1,})
Result:
1. expected = os.path.normpath(testdata.mypath+'/examples/a/new/branch') 2. expected = os.path.normpath(testdata.mypath+'/examples/a/b0/c/a/b0/c/new/branch') 3. expected = os.path.normpath(testdata.mypath+'/examples/a/b0/c/new/branch') 4. expected = os.path.normpath(testdata.mypath+'/examples/a/b0/c/a/b0/c/new/branch') 5. expected = os.path.normpath(testdata.mypath+'/examples/a/b0/c/new/branch')
-
class
UseCases.FileSysObjects.branches.searchHookPointForSideBranchStr.CallCase.
UseCase
(*args, **kargs)[source]¶ Bases:
unittest.case.TestCase
-
testCase003
()[source]¶ - search and create a path for a side branch - use the second plist entry + reverse the order
-