From 1379a9b1851e203611c490218fe62ef808a7d0ae Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 4 Jan 2021 23:29:45 -0500 Subject: launcher: add test for version requirements Make sure the modules stay in sync in case one is updated but we forgot to update the other. Bug: https://crbug.com/gerrit/13795 Change-Id: I6de9533d45c083e5f7ad792ee6d541e23647de3f Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/292444 Reviewed-by: Michael Mortensen Tested-by: Mike Frysinger --- tests/test_wrapper.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/test_wrapper.py') diff --git a/tests/test_wrapper.py b/tests/test_wrapper.py index 069a5c3b..d7e5800f 100644 --- a/tests/test_wrapper.py +++ b/tests/test_wrapper.py @@ -26,6 +26,7 @@ import tempfile import unittest import git_command +import main import platform_utils from pyversion import is_python3 import wrapper @@ -83,6 +84,16 @@ class RepoWrapperUnitTest(RepoWrapperTestCase): self.assertEqual('', stderr.getvalue()) self.assertIn('repo launcher version', stdout.getvalue()) + def test_python_constraints(self): + """The launcher should never require newer than main.py.""" + self.assertGreaterEqual(main.MIN_PYTHON_VERSION_HARD, + wrapper.MIN_PYTHON_VERSION_HARD) + self.assertGreaterEqual(main.MIN_PYTHON_VERSION_SOFT, + wrapper.MIN_PYTHON_VERSION_SOFT) + # Make sure the versions are themselves in sync. + self.assertGreaterEqual(wrapper.MIN_PYTHON_VERSION_SOFT, + wrapper.MIN_PYTHON_VERSION_HARD) + def test_init_parser(self): """Make sure 'init' GetParser works.""" parser = self.wrapper.GetParser(gitc_init=False) -- cgit v1.2.3-54-g00ecf