UseCases.FileSysObjects.branches.searchHookSliceForSideBranch package

Submodules

UseCases.FileSysObjects.branches.searchHookSliceForSideBranch.CallCase module

Create a plist, find side branches with slices of multi-node hooks.

E.g. the branch ‘a/b0/F[0-7]*’, which maps the slice ‘a/b0’ and extends at ‘a/b0’ by ‘glob’
testdata.mypath+/examples/a/b0/c/a/b0/c
__________________________a/b0/    
______________________________`--F[0-7]*
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('c/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('b0/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('b0/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('b0/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('b0/c/new/branch')
    rp = getTopFromPathString(sp,self._plist,**{'matchlvlupward':1,})
    
  • Result:

    1. expected = os.path.normpath(testdata.mypath+'/examples/a/b0/c/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.searchHookSliceForSideBranch.CallCase.UseCase(*args, **kargs)[source]

Bases: unittest.case.TestCase

testCase010()[source]
  1. search and create a path for a side branch
testCase020()[source]
  1. search and create a path for a side branch
testCase1001b()[source]
  1. search and create a path for a side branch
testCase1001c()[source]
  1. search and create a path for a side branch
testCase1001d()[source]
  1. search and create a path for a side branch - use the second plist entry
testCase1002()[source]
  1. search and create a path for a side branch - use the second plist entry
testCase1003()[source]
  1. search and create a path for a side branch - use the second plist entry + reverse the order
testCase1003a()[source]
  1. search and create a path for a side branch - use the second plist entry + reverse the order
testCase1003b()[source]
  1. search and create a path for a side branch - use the second plist entry + reverse the order
testCase1003c()[source]
  1. search and create a path for a side branch - use the second plist entry + reverse the order
testCase1003d()[source]
  1. search and create a path for a side branch - use the second plist entry + reverse the order
testCase1003e()[source]
  1. search and create a path for a side branch - use the second plist entry + reverse the order

Module contents