def test_get_repository_root(script): version_pkg_path = _create_test_package(script, vcs="hg") tests_path = version_pkg_path.joinpath("tests") tests_path.mkdir() root1 = Mercurial.get_repository_root(version_pkg_path) assert os.path.normcase(root1) == os.path.normcase(version_pkg_path) root2 = Mercurial.get_repository_root(version_pkg_path.joinpath("tests")) assert os.path.normcase(root2) == os.path.normcase(version_pkg_path)
def test_get_repository_root(script: PipTestEnvironment) -> None: version_pkg_path = _create_test_package(script, vcs="hg") tests_path = version_pkg_path.joinpath("tests") tests_path.mkdir() root1 = Mercurial.get_repository_root(version_pkg_path) assert root1 is not None assert os.path.normcase(root1) == os.path.normcase(version_pkg_path) root2 = Mercurial.get_repository_root(version_pkg_path.joinpath("tests")) assert root2 is not None assert os.path.normcase(root2) == os.path.normcase(version_pkg_path)