UseCases.FileSysObjects.branches.searchHookPointForSideBranch package

Submodules

UseCases.FileSysObjects.branches.searchHookPointForSideBranch.CallCase module

Create a plist, find side branches with single-node hooks.

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.searchHookPointForSideBranch.CallCase.UseCase(*args, **kargs)[source]

Bases: unittest.case.TestCase

setUp()[source]
testCase001()[source]
  1. search and create a path for a side branch
testCase002()[source]
  1. search and create a path for a side branch - use the second plist entry
testCase003()[source]
  1. search and create a path for a side branch - use the second plist entry + reverse the order
testCase004()[source]
  1. search and create a path for a side branch - match a path entry with and use the second match within a path entry
testCase005()[source]
  1. search and create a path for a side branch UPWARD - match a path entry with and use the second match within a path entry

Module contents