Add support for 'connection' concept
This is a large refactor and as small as I could feasibly make it
while keeping the tests working. I'll do the documentation and
touch ups in the next commit to make digesting easier.
Change-Id: Iac5083996a183d1d8a9b6cb8f70836f7c39ee910
diff --git a/tests/test_gerrit.py b/tests/test_gerrit.py
index dad2c6d..93ce122 100644
--- a/tests/test_gerrit.py
+++ b/tests/test_gerrit.py
@@ -21,7 +21,7 @@
import mock
from tests.base import BaseTestCase
-from zuul.lib.gerrit import Gerrit
+from zuul.connection.gerrit import GerritConnection
FIXTURE_DIR = os.path.join(os.path.dirname(__file__), 'fixtures/gerrit')
@@ -46,9 +46,13 @@
class TestGerrit(BaseTestCase):
- @mock.patch('zuul.lib.gerrit.Gerrit._ssh')
+ @mock.patch('zuul.connection.gerrit.GerritConnection._ssh')
def run_query(self, files, expected_patches, _ssh_mock):
- gerrit = Gerrit('localhost', 'user')
+ gerrit_config = {
+ 'user': 'gerrit',
+ 'server': 'localhost',
+ }
+ gerrit = GerritConnection('review_gerrit', gerrit_config)
calls, values = read_fixtures(files)
_ssh_mock.side_effect = values