gerrit_client: introduce add message command

Bug: 378480632
Change-Id: I411b3136db27a5ca2b43481bc9b650bef93f5275
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6012758
Auto-Submit: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Scott Lee <ddoman@chromium.org>
This commit is contained in:
Yiwei Zhang
2024-11-11 21:34:55 +00:00
committed by LUCI CQ
parent ff14128b8a
commit dcaa6afa97
2 changed files with 41 additions and 0 deletions

View File

@@ -158,6 +158,23 @@ class TestGerritClient(unittest.TestCase):
1,
labels={'some-label': '-2'})
@mock.patch('gerrit_util.SetReview', return_value='')
def test_addmessage(self, util_mock):
gerrit_client.main([
'addmessage',
'--host',
'https://example.org/foo',
'-c',
'1',
'-r',
'2',
'-m',
'This is a message',
])
util_mock.assert_called_once_with('example.org',
1,
revision='2',
msg='This is a message')
if __name__ == '__main__':
logging.basicConfig(