예제 #1
0
def PathsToAllParentFolders_WindowsPath_test():
  eq_( [
    os.path.normpath( r'C:/foo/goo/zoo' ),
    os.path.normpath( r'C:/foo/goo' ),
    os.path.normpath( r'C:/foo' ),
    os.path.normpath( r'C:/' )
  ], list( _PathsToAllParentFolders( r'C:/foo/goo/zoo/test.c' ) ) )
예제 #2
0
def PathsToAllParentFolders_Basic_test():
  eq_( [
    os.path.normpath( '/home/user/projects' ),
    os.path.normpath( '/home/user' ),
    os.path.normpath( '/home' ),
    os.path.normpath( '/' )
  ], list( _PathsToAllParentFolders( '/home/user/projects/test.c' ) ) )
예제 #3
0
def PathsToAllParentFolders_WindowsPath_test():
    eq_([r'C:/foo/goo/zoo', r'C:/foo/goo', r'C:/foo', 'C:'],
        list(_PathsToAllParentFolders(r'C:/foo/goo/zoo/test.c')))
예제 #4
0
def PathsToAllParentFolders_FileAtRoot_test():
    eq_(['/'], list(_PathsToAllParentFolders('/test.c')))
예제 #5
0
def PathsToAllParentFolders_Basic_test():
    eq_(['/home/user/projects', '/home/user', '/home', '/'],
        list(_PathsToAllParentFolders('/home/user/projects/test.c')))
예제 #6
0
def PathsToAllParentFolders_FileAtRoot_test():
  eq_( [ os.path.normpath( '/' ) ],
       list( _PathsToAllParentFolders( '/test.c' ) ) )
예제 #7
0
def PathsToAllParentFolders_WindowsPath_test():
  eq_( [ r'C:/foo/goo/zoo', r'C:/foo/goo', r'C:/foo', 'C:' ],
       list( _PathsToAllParentFolders( r'C:/foo/goo/zoo/test.c' ) ) )
예제 #8
0
def PathsToAllParentFolders_FileAtRoot_test():
  eq_( [ '/' ],
       list( _PathsToAllParentFolders( '/test.c' ) ) )
예제 #9
0
def PathsToAllParentFolders_Basic_test():
  eq_( [ '/home/user/projects', '/home/user', '/home', '/' ],
       list( _PathsToAllParentFolders( '/home/user/projects/test.c' ) ) )