[gerrit_client] Fix test to not hit real gerrit service.

There may be other tests which aren't correct though, this is just
the one I saw during presubmit.

R=aravindvasudev@google.com

Bug: 330347045
Change-Id: I6499b5103bf15c30f5e8a2fdcd7abeba094a39d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5394357
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
changes/57/5394357/3
Robert Iannucci 11 months ago committed by LUCI CQ
parent 1cba129f31
commit b6f459b87c

@ -27,13 +27,16 @@ class TestGerritClient(unittest.TestCase):
'branchname')
@mock.patch('gerrit_util.CreateGerritBranch', return_value='')
def test_branch(self, util_mock):
@mock.patch('gerrit_util.GetGerritBranch', return_value='')
def test_branch(self, _, CreateGerritBranch_mock):
gerrit_client.main([
'branch', '--host', 'https://example.org/foo', '--project',
'projectname', '--branch', 'branchname', '--commit', 'commitname'
])
util_mock.assert_called_once_with('example.org', 'projectname',
'branchname', 'commitname')
CreateGerritBranch_mock.assert_called_once_with('example.org',
'projectname',
'branchname',
'commitname')
@mock.patch('gerrit_util.QueryChanges', return_value='')
def test_changes(self, util_mock):

Loading…
Cancel
Save