def test_git_clone_ssh_auth_method_missing_ssh_key(self, mock_os): mock_os.path.exists.return_value = False fake_user = test_utils.rand_name('fake_user') url = ('ssh://%[email protected]:29418/att-comdev/armada' % fake_user) self.assertRaises( source_exceptions.GitSSHException, source.git_clone, url, ref='refs/changes/17/388517/5', auth_method='SSH')
def test_git_clone_ssh_auth_method_fails_auth(self, mock_os): mock_os.path.exists.return_value = True fake_user = test_utils.rand_name('fake_user') url = ('ssh://%[email protected]:29418/airship/armada' % fake_user) self.assertRaises(source_exceptions.GitAuthException, source.git_clone, url, ref='refs/changes/17/388517/5', auth_method='SSH')
def test_git_clone_fake_proxy(self): url = 'http://github.com/att-comdev/armada' proxy_url = test_utils.rand_name( 'not.a.proxy.that.works.and.never.will', prefix='http://') + ":8080" self.assertRaises( source_exceptions.GitProxyException, source.git_clone, url, proxy_server=proxy_url)
def test_git_clone_fake_proxy(self): url = 'https://opendev.org/airship/armada.git' proxy_url = test_utils.rand_name( 'not.a.proxy.that.works.and.never.will', prefix='http://') + ":8080" self.assertRaises(source_exceptions.GitProxyException, source.git_clone, url, proxy_server=proxy_url)