artifacts: Warn if no pinned images found.
...as opposed to dying. There may be arbitrarily
many pinned guest images. This means having zero
is acceptable.
TEST=./run_tests
BUG=chromium:953025
Change-Id: I918c1bbb2f28a71dfde823dd2514c01945465acc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/1576410
Tested-by: Evan Hernandez <evanhernandez@chromium.org>
Reviewed-by: Alex Klein <saklein@chromium.org>
Commit-Queue: Evan Hernandez <evanhernandez@chromium.org>
diff --git a/api/controller/artifacts_unittest.py b/api/controller/artifacts_unittest.py
index 57ad67a..0fadcb8 100644
--- a/api/controller/artifacts_unittest.py
+++ b/api/controller/artifacts_unittest.py
@@ -118,11 +118,11 @@
[mock.call('/cros', 'target', '/tmp/artifacts')])
def testBundlePinnedGuestImagesNoLogs(self):
- """BundlePinnedGuestImages dies when no pinned images found."""
+ """BundlePinnedGuestImages does not die when no pinned images found."""
self.PatchObject(commands, 'BuildPinnedGuestImagesTarball',
return_value=None)
- with self.assertRaises(cros_build_lib.DieSystemExit):
- artifacts.BundlePinnedGuestImages(self.input_proto, self.output_proto)
+ artifacts.BundlePinnedGuestImages(self.input_proto, self.output_proto)
+ self.assertFalse(self.output_proto.artifacts)
class BundleFirmwareTest(BundleTestCase):