BinhostService: Refactor PrepareBinhostUploads and RegenBuildCache
BUG=chromium:963215, chromium:963211, b:132732435, b:132732743
TEST=run_tests
Change-Id: I708f7f3dc13b6e3f3ec2e861490aad1400331421
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/1640829
Reviewed-by: Alex Klein <saklein@chromium.org>
Tested-by: Alex Klein <saklein@chromium.org>
diff --git a/api/controller/binhost_unittest.py b/api/controller/binhost_unittest.py
index 1ae869d..1527856 100644
--- a/api/controller/binhost_unittest.py
+++ b/api/controller/binhost_unittest.py
@@ -78,11 +78,10 @@
input_proto = binhost_pb2.RegenBuildCacheRequest()
input_proto.overlay_type = binhost_pb2.OVERLAYTYPE_BOTH
- input_proto.sysroot.path = '/path/to/chroot'
- input_proto.sysroot.build_target.name = 'target'
+ output_proto = binhost_pb2.RegenBuildCacheResponse()
- binhost.RegenBuildCache(input_proto)
- regen_cache.assert_called_once_with('both', '/path/to/chroot')
+ binhost.RegenBuildCache(input_proto, output_proto)
+ regen_cache.assert_called_once_with('both')
def testRequiresOverlayType(self):
"""RegenBuildCache dies if overlay_type not specified."""
@@ -91,9 +90,8 @@
input_proto = binhost_pb2.RegenBuildCacheRequest()
input_proto.overlay_type = binhost_pb2.OVERLAYTYPE_UNSPECIFIED
- input_proto.sysroot.path = '/path/to/chroot'
- input_proto.sysroot.build_target.name = 'target'
+ output_proto = binhost_pb2.RegenBuildCacheResponse()
- binhost.RegenBuildCache(input_proto)
+ binhost.RegenBuildCache(input_proto, output_proto)
die.assert_called_once()
regen_cache.assert_not_called()