Example #1
0
 def test_1(self):
     n = lambda path: path.replace('/', sep)
     assert_equal(minrelpath(n('aa/bb')), n('aa/bb'))
     assert_equal(minrelpath('..'), '..')
     assert_equal(minrelpath(n('aa/..')), '')
     assert_equal(minrelpath(n('aa/../bb')), 'bb')
     assert_equal(minrelpath(n('aa/bb/..')), 'aa')
     assert_equal(minrelpath(n('aa/bb/../..')), '')
     assert_equal(minrelpath(n('aa/bb/../cc/../dd')), n('aa/dd'))
     assert_equal(minrelpath(n('.././..')), n('../..'))
     assert_equal(minrelpath(n('aa/bb/.././../dd')), n('dd'))
Example #2
0
 def test_1(self):
     n = lambda path: path.replace('/',sep)
     assert_equal(minrelpath(n('aa/bb')),n('aa/bb'))
     assert_equal(minrelpath('..'),'..')
     assert_equal(minrelpath(n('aa/..')),'')
     assert_equal(minrelpath(n('aa/../bb')),'bb')
     assert_equal(minrelpath(n('aa/bb/..')),'aa')
     assert_equal(minrelpath(n('aa/bb/../..')),'')
     assert_equal(minrelpath(n('aa/bb/../cc/../dd')),n('aa/dd'))
     assert_equal(minrelpath(n('.././..')),n('../..'))
     assert_equal(minrelpath(n('aa/bb/.././../dd')),n('dd'))
Example #3
0
 def test_1(self):
     n = lambda path: path.replace("/", sep)
     assert_equal(minrelpath(n("aa/bb")), n("aa/bb"))
     assert_equal(minrelpath(".."), "..")
     assert_equal(minrelpath(n("aa/..")), "")
     assert_equal(minrelpath(n("aa/../bb")), "bb")
     assert_equal(minrelpath(n("aa/bb/..")), "aa")
     assert_equal(minrelpath(n("aa/bb/../..")), "")
     assert_equal(minrelpath(n("aa/bb/../cc/../dd")), n("aa/dd"))
     assert_equal(minrelpath(n(".././..")), n("../.."))
     assert_equal(minrelpath(n("aa/bb/.././../dd")), n("dd"))
Example #4
0
 def test_1(self):
     n = lambda path: path.replace("/", sep)
     assert_equal(minrelpath(n("aa/bb")), n("aa/bb"))
     assert_equal(minrelpath(".."), "..")
     assert_equal(minrelpath(n("aa/..")), "")
     assert_equal(minrelpath(n("aa/../bb")), "bb")
     assert_equal(minrelpath(n("aa/bb/..")), "aa")
     assert_equal(minrelpath(n("aa/bb/../..")), "")
     assert_equal(minrelpath(n("aa/bb/../cc/../dd")), n("aa/dd"))
     assert_equal(minrelpath(n(".././..")), n("../.."))
     assert_equal(minrelpath(n("aa/bb/.././../dd")), n("dd"))
 def check_1(self):
     import os
     n = lambda path: path.replace('/', os.path.sep)
     assert_equal(minrelpath(n('aa/bb')), n('aa/bb'))
     assert_equal(minrelpath('..'), '..')
     assert_equal(minrelpath(n('aa/..')), '')
     assert_equal(minrelpath(n('aa/../bb')), 'bb')
     assert_equal(minrelpath(n('aa/bb/..')), 'aa')
     assert_equal(minrelpath(n('aa/bb/../..')), '')
     assert_equal(minrelpath(n('aa/bb/../cc/../dd')), n('aa/dd'))
     assert_equal(minrelpath(n('.././..')), n('../..'))
     assert_equal(minrelpath(n('aa/bb/.././../dd')), n('dd'))
Example #6
0
 def check_1(self):
     import os
     n = lambda path: path.replace('/',os.path.sep)
     assert_equal(minrelpath(n('aa/bb')),n('aa/bb'))
     assert_equal(minrelpath('..'),'..')
     assert_equal(minrelpath(n('aa/..')),'')
     assert_equal(minrelpath(n('aa/../bb')),'bb')
     assert_equal(minrelpath(n('aa/bb/..')),'aa')
     assert_equal(minrelpath(n('aa/bb/../..')),'')
     assert_equal(minrelpath(n('aa/bb/../cc/../dd')),n('aa/dd'))
     assert_equal(minrelpath(n('.././..')),n('../..'))
     assert_equal(minrelpath(n('aa/bb/.././../dd')),n('dd'))
 def check_gpaths(self):
     local_path = minrelpath(os.path.join(os.path.dirname(__file__), '..'))
     ls = gpaths('command/*.py', local_path)
     assert os.path.join(local_path, 'command',
                         'build_src.py') in ls, ` ls `
     f = gpaths('system_info.py', local_path)
     assert os.path.join(local_path, 'system_info.py') == f[0], ` f `
Example #8
0
 def test_gpaths(self):
     local_path = minrelpath(join(dirname(__file__), '..'))
     ls = gpaths('command/*.Dockerfile', local_path)
     assert_(
         join(local_path, 'command', 'build_src.Dockerfile') in ls,
         repr(ls))
     f = gpaths('system_info.Dockerfile', local_path)
     assert_(join(local_path, 'system_info.Dockerfile') == f[0], repr(f))
Example #9
0
 def test_gpaths(self):
     local_path = minrelpath(join(dirname(__file__),'..'))
     ls = gpaths('command/*.py', local_path)
     assert join(local_path,'command','build_src.py') in ls,`ls`
     f = gpaths('system_info.py', local_path)
     assert join(local_path,'system_info.py')==f[0],`f`
Example #10
0
 def test_gpaths(self):
     local_path = minrelpath(join(dirname(__file__), ".."))
     ls = gpaths("command/*.py", local_path)
     assert_(join(local_path, "command", "build_src.py") in ls, ` ls `)
     f = gpaths("system_info.py", local_path)
     assert_(join(local_path, "system_info.py") == f[0], ` f `)
Example #11
0
 def test_gpaths(self):
     local_path = minrelpath(join(dirname(__file__), '..'))
     ls = gpaths('command/*.py', local_path)
     assert_(join(local_path, 'command', 'build_src.py') in ls, ` ls `)
     f = gpaths('system_info.py', local_path)
     assert_(join(local_path, 'system_info.py') == f[0], ` f `)
Example #12
0
 def test_gpaths(self):
     local_path = minrelpath(join(dirname(__file__), ".."))
     ls = gpaths("command/*.py", local_path)
     assert_(join(local_path, "command", "build_src.py") in ls, repr(ls))
     f = gpaths("system_info.py", local_path)
     assert_(join(local_path, "system_info.py") == f[0], repr(f))