Merge "web: fix connections list github base_url"

This commit is contained in:
Zuul 2019-09-08 05:55:10 +00:00 committed by Gerrit Code Review
commit da4d35aaf4
2 changed files with 24 additions and 1 deletions

View File

@ -1539,3 +1539,26 @@ class TestTenantScopedWebApiWithAuthRules(BaseTestWeb):
json=change)
self.assertEqual(200, req.status_code, req.text)
self.waitUntilSettled()
class TestWebMulti(BaseTestWeb):
config_file = 'zuul-gerrit-github.conf'
def test_web_connections_list_multi(self):
data = self.get_url('api/connections').json()
gerrit_connection = {
'driver': 'gerrit',
'name': 'gerrit',
'baseurl': 'https://review.example.com',
'canonical_hostname': 'review.example.com',
'server': 'review.example.com',
'port': 29418,
}
github_connection = {
'baseurl': 'https://api.github.com',
'canonical_hostname': 'github.com',
'driver': 'github',
'name': 'github',
'server': 'github.com',
}
self.assertEqual([gerrit_connection, github_connection], data)

View File

@ -771,7 +771,7 @@ class GithubConnection(BaseConnection):
def toDict(self):
d = super().toDict()
d.update({
"baseurl": self.baseurl,
"baseurl": self.base_url,
"canonical_hostname": self.canonical_hostname,
"server": self.server,
})