def test_commit_url_github(self): """Verify that GitHub URLs without ".git" are unaltered.""" repo_url = "https://github.com/openstack/openstack-ansible" result = osa_differ.get_commit_url(repo_url) assert result == repo_url
def test_commit_url_openstack(self): """Verify that OpenStack URLs are fixed.""" repo_url = "https://git.openstack.org/cgit/openstack/openstack-ansible" result = osa_differ.get_commit_url(repo_url) assert result == "https://github.com/openstack/openstack-ansible"
def test_commit_url_unknown(self): """Verify that unknown URLs are unaltered.""" repo_url = "https://reddit.com" result = osa_differ.get_commit_url(repo_url) assert result == repo_url
def test_commit_url_github_ending_with_dotgit(self): """Verify that ".git" is stripped from GitHub URLs.""" repo_url = "https://github.com/openstack/openstack-ansible.git" result = osa_differ.get_commit_url(repo_url) assert result == repo_url[:-4]