def test_pass_through_http(self, get_ssh_config): get_ssh_config.return_value = MockSshConfig() url ='https://github.com/omab/django-social-auth.git' actual_url = annotate_url_with_ssh_config_info(url, logger) self.assertEqual(url,actual_url)
def test_annotate_readonly_url(self, get_ssh_config): get_ssh_config.return_value = MockSshConfig() url ='git://opbeat_python/roncohen/django-hstore.git' actual_url = annotate_url_with_ssh_config_info(url, logger) self.assertEqual('git://github.com/roncohen/django-hstore.git',actual_url)
def test_annotate(self, get_ssh_config): get_ssh_config.return_value = MockSshConfig() url ='git@opbeat_python:opbeat/opbeat_python.git' actual_url = annotate_url_with_ssh_config_info(url, logger) self.assertEqual('[email protected]:opbeat/opbeat_python.git',actual_url)
def test_annotate_mercurial(self, get_ssh_config): get_ssh_config.return_value = MockSshConfig() url = 'ssh://hg@opbeat_python/username/reponame/' actual_url = annotate_url_with_ssh_config_info(url, logger) self.assertEqual('ssh://[email protected]/username/reponame/',actual_url)
def test_pass_through(self, get_ssh_config): get_ssh_config.return_value = MockSshConfig() pass_through_url = "[email protected]:opbeat/opbeatcli.git" actual_url = annotate_url_with_ssh_config_info(pass_through_url, logger) self.assertEqual(pass_through_url,actual_url)