示例#1
0
def test_abspath_relative():
    testname = "error.json"
    relative = os.path.join(os.getcwd(), "tests/specs/with_externals.yaml")
    res = fs.abspath(testname, relative)
    expected = fs.to_posix(
        os.path.join(os.getcwd(), "tests", "specs", testname))
    assert res == expected
示例#2
0
def test_abspath_relative_dir():
    testname = "error.json"
    relative = os.path.join(os.getcwd(), "tests", "specs")
    res = fs.abspath(testname, relative)
    expected = fs.to_posix(
        os.path.join(os.getcwd(), "tests", "specs", testname))
    assert res == expected
示例#3
0
def test_abspath_relative_dir():
    testname = 'error.json'
    relative = os.path.join(os.getcwd(), 'tests', 'specs')
    res = fs.abspath(testname, relative)
    expected = fs.to_posix(
        os.path.join(os.getcwd(), 'tests', 'specs', testname))
    assert res == expected
示例#4
0
def test_abspath_relative():
    testname = 'error.json'
    relative = os.path.join(os.getcwd(), 'tests/specs/with_externals.yaml')
    res = fs.abspath(testname, relative)
    expected = fs.to_posix(
        os.path.join(os.getcwd(), 'tests', 'specs', testname))
    assert res == expected
示例#5
0
def test_to_posix_abs():
  if sys.platform == "win32":
    test = "c:\\windows\\notepad.exe"
    expected = "/c:/windows/notepad.exe"
  else:
    test = "/etc/passwd"
    expected = test
  assert fs.to_posix(test) == expected
示例#6
0
def test_abspath_basics():
    testname = os.path.normpath("tests/specs/with_externals.yaml")
    res = fs.abspath(testname)
    expected = fs.to_posix(os.path.join(os.getcwd(), testname))
    assert res == expected
示例#7
0
def test_to_posix_abs_win32():
    test = "c:\\windows\\notepad.exe"
    expected = "/c:/windows/notepad.exe"
    assert fs.to_posix(test) == expected
示例#8
0
def test_to_posix_abs_posix():
    test = "/etc/passwd"
    expected = test
    assert fs.to_posix(test) == expected
示例#9
0
def test_to_posix_rel():
    test = "tests/specs/with_externals.yaml"
    assert fs.to_posix(os.path.normpath(test)) == test