def test_resolve_local(self): origpath = os.getcwd() os.chdir(os.path.join(get_data(""))) def norm(uri): if onWindows(): return uri.lower() else: return uri try: root = Path.cwd() rooturi = root.as_uri() self.assertEqual(norm(rooturi+"/tests/echo.cwl"), norm(resolve_local(None, os.path.join("tests", "echo.cwl")))) self.assertEqual(norm(rooturi+"/tests/echo.cwl#main"), norm(resolve_local(None, os.path.join("tests", "echo.cwl")+"#main"))) self.assertEqual(norm(rooturi+"/tests/echo.cwl"), norm(resolve_local(None, str(root / "tests" / "echo.cwl")))) self.assertEqual(norm(rooturi+"/tests/echo.cwl#main"), norm(resolve_local(None, str(root / "tests" / "echo.cwl")+"#main"))) finally: os.chdir(origpath)
def test_resolve_local(self): origpath = os.getcwd() os.chdir(os.path.join(get_data(""))) def norm(uri): if onWindows(): return uri.lower() else: return uri try: root = Path.cwd() rooturi = root.as_uri() self.assertEqual( norm(rooturi + "/tests/echo.cwl"), norm(resolve_local(None, os.path.join("tests", "echo.cwl")))) self.assertEqual( norm(rooturi + "/tests/echo.cwl#main"), norm( resolve_local(None, os.path.join("tests", "echo.cwl") + "#main"))) self.assertEqual( norm(rooturi + "/tests/echo.cwl"), norm(resolve_local(None, str(root / "tests" / "echo.cwl")))) self.assertEqual( norm(rooturi + "/tests/echo.cwl#main"), norm( resolve_local(None, str(root / "tests" / "echo.cwl") + "#main"))) finally: os.chdir(origpath)
def test_resolve_local(path, expected_path): def norm(uri): if onWindows(): return uri.lower() return uri with working_directory(root): expected = norm(root.as_uri() + expected_path) assert norm(resolve_local(None, path)) == expected
def test_resolve_local(path, expected_path): with working_directory(root): expected = norm(root.as_uri() + expected_path) assert norm(resolve_local(None, path)) == expected
def test_resolve_local(path: str, expected_path: str) -> None: with working_directory(root): expected = root.as_uri() + expected_path resolved = resolve_local(None, path) assert resolved assert resolved == expected