git-cl: Re-write some tests to use mock.
I think this makes tests easier to read and write.
Change-Id: I9430a5d40e3466ff2a24b6b40253419aea3f30b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1820034
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
diff --git a/git_cl.py b/git_cl.py
index 09d9084..c8c02e0 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -362,7 +362,7 @@
assert False, 'unreachable'
-def _call_buildbucket(http, buildbucket_host, method, request=None):
+def _call_buildbucket(http, buildbucket_host, method, request):
"""Calls a buildbucket v2 method and returns the parsed json response."""
headers = {
'Accept': 'application/json',
@@ -506,7 +506,7 @@
batch_request = {'requests': requests}
batch_response = _call_buildbucket(
- http, options.buildbucket_host, 'Batch', request=batch_request)
+ http, options.buildbucket_host, 'Batch', batch_request)
errors = [
' ' + response['error']['message']