def test_get_git_origin_without_origin_set(tmpdir): """ Verify that the git repository without remote "origin" set returns None on getting origin URL through get_git_origin """ repo_dir = tmpdir / "target-repo" repo = git.Repo.init(repo_dir) response = get_git_origin(repo_dir) assert response is None
def test_get_git_origin_with_ssh_origin_without_git(tmpdir): """ Verify that the origin URL is retrieved through get_git_origin on valid git repository with origin set """ url = "[email protected]:edx/pytest-repo-health" repo_dir = tmpdir / "target-repo" repo = git.Repo.init(repo_dir) repo.create_remote("origin", url=url) response = get_git_origin(repo_dir) assert response == 'pytest-repo-health'