def test_parse_git_url_from_git_repo(): project = LocalProject( git_repo=flexmock( remotes=[flexmock(name="origin", url="[email protected]:org/name")]), refresh=False, ) changed = project._parse_git_url_from_git_repo() assert changed assert project.git_repo assert project.git_url == "[email protected]:org/name"
def test_parse_git_url_from_git_repo(): project = LocalProject( git_repo=flexmock().should_receive("remote") # must be a generator .replace_with(lambda: flexmock(urls=( x for x in ["[email protected]:org/name"]))).once().mock(), refresh=False, ) changed = project._parse_git_url_from_git_repo() assert changed assert project.git_repo assert project.git_url == "[email protected]:org/name"