From c121709575c2c01109b3a0755463f0809967e1d1 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Fri, 1 Mar 2019 14:02:58 +0000 Subject: [PATCH] Test API max version is in RELEASE_MAPPINGS This should catch the case where the API version has been updated but release mappings has not (or vice versa). Change-Id: I62183d329c0efe9fe3bd47a0ca478155075b3230 --- ironic/tests/unit/api/controllers/v1/test_versions.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ironic/tests/unit/api/controllers/v1/test_versions.py b/ironic/tests/unit/api/controllers/v1/test_versions.py index 9f265b5ec9..3025429506 100644 --- a/ironic/tests/unit/api/controllers/v1/test_versions.py +++ b/ironic/tests/unit/api/controllers/v1/test_versions.py @@ -80,6 +80,11 @@ class TestMaxVersionString(base.TestCase): self.assertEqual(versions._MAX_VERSION_STRING, versions.max_version_string()) + def test_max_version_not_pinned_in_release_mappings(self): + CONF.set_override('pin_release_version', None) + self.assertEqual(release_mappings.RELEASE_MAPPING['master']['api'], + versions.max_version_string()) + @mock.patch('ironic.common.release_mappings.RELEASE_MAPPING', autospec=True) def test_max_version_pinned(self, mock_release_mapping):