cbuildbot_launch: Use constants.py to find REEXEC versions.
In unittests, using hardcoded reexec versions falls out of date when
versions are updated, but we really want to check the behavior when
working with the latest version of cbuildbot. So... use the same
constants that define the 'latest' version.
BUG=None
TEST=Ran unittests.
Change-Id: I7445629ca9b83baf6a0b4d9552de3cb3d04513f8
Reviewed-on: https://chromium-review.googlesource.com/506558
Commit-Ready: Don Garrett <dgarrett@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Paul Hobbs <phobbs@google.com>
diff --git a/scripts/cbuildbot_launch_unittest.py b/scripts/cbuildbot_launch_unittest.py
index e9b46c2..4d3eed2 100644
--- a/scripts/cbuildbot_launch_unittest.py
+++ b/scripts/cbuildbot_launch_unittest.py
@@ -10,6 +10,7 @@
import os
from chromite.cbuildbot import repository
+from chromite.lib import constants
from chromite.lib import cros_build_lib
from chromite.lib import cros_build_lib_unittest
from chromite.lib import cros_test_lib
@@ -167,7 +168,8 @@
"""Test a minimal set of command line options."""
self.PatchObject(osutils, 'SafeMakedirs', autospec=True)
self.PatchObject(cros_build_lib, 'GetTargetChromiteApiVersion',
- autospec=True, return_value=(0, 4))
+ autospec=True, return_value=(constants.REEXEC_API_MAJOR,
+ constants.REEXEC_API_MINOR))
mock_clean = self.PatchObject(cbuildbot_launch, 'CleanBuildroot',
autospec=True)
mock_checkout = self.PatchObject(cbuildbot_launch, 'InitialCheckout',
@@ -193,7 +195,8 @@
"""Test a larger set of command line options."""
self.PatchObject(osutils, 'SafeMakedirs', autospec=True)
self.PatchObject(cros_build_lib, 'GetTargetChromiteApiVersion',
- autospec=True, return_value=(0, 4))
+ autospec=True, return_value=(constants.REEXEC_API_MAJOR,
+ constants.REEXEC_API_MINOR))
mock_clean = self.PatchObject(cbuildbot_launch, 'CleanBuildroot',
autospec=True)
mock_checkout = self.PatchObject(cbuildbot_launch, 'InitialCheckout',