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
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
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
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
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
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
def test_to_posix_abs_win32(): test = "c:\\windows\\notepad.exe" expected = "/c:/windows/notepad.exe" assert fs.to_posix(test) == expected
def test_to_posix_abs_posix(): test = "/etc/passwd" expected = test assert fs.to_posix(test) == expected
def test_to_posix_rel(): test = "tests/specs/with_externals.yaml" assert fs.to_posix(os.path.normpath(test)) == test