From ebb8d5e63413154a95c515668f1983756e296f00 Mon Sep 17 00:00:00 2001 From: Jim Rollenhagen Date: Tue, 24 Jul 2018 13:14:57 +0000 Subject: [PATCH] Be more precise with conductor group API tests Use 1.45 as the "bad" version for conductor group API tests, as this is the last version that does not support it. Change-Id: I20ae5531e3d52eb270411cfa068d3c20211bcd5e --- ironic/tests/unit/api/controllers/v1/test_node.py | 8 ++++---- ironic/tests/unit/api/controllers/v1/test_utils.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ironic/tests/unit/api/controllers/v1/test_node.py b/ironic/tests/unit/api/controllers/v1/test_node.py index 5d5915ffa6..ccdada419b 100644 --- a/ironic/tests/unit/api/controllers/v1/test_node.py +++ b/ironic/tests/unit/api/controllers/v1/test_node.py @@ -405,7 +405,7 @@ class TestListNodes(test_api_base.BaseApiTest): fields = 'conductor_group' response = self.get_json( '/nodes/%s?fields=%s' % (node.uuid, fields), - headers={api_base.Version.string: '1.44'}, + headers={api_base.Version.string: '1.45'}, expect_errors=True) self.assertEqual(http_client.NOT_ACCEPTABLE, response.status_int) @@ -1445,7 +1445,7 @@ class TestListNodes(test_api_base.BaseApiTest): for url in ('/nodes?conductor_group=group1', '/nodes/detail?conductor_group=group1'): response = self.get_json( - url, headers={api_base.Version.string: "1.44"}, + url, headers={api_base.Version.string: "1.45"}, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(http_client.NOT_ACCEPTABLE, response.status_code) @@ -2548,7 +2548,7 @@ class TestPatch(test_api_base.BaseApiTest): node = obj_utils.create_test_node(self.context, uuid=uuidutils.generate_uuid()) self.mock_update_node.return_value = node - headers = {api_base.Version.string: '1.44'} + headers = {api_base.Version.string: '1.45'} response = self.patch_json('/nodes/%s' % node.uuid, [{'path': '/conductor_group', 'value': 'foogroup', @@ -2790,7 +2790,7 @@ class TestPost(test_api_base.BaseApiTest): self.assertEqual('foo', result['conductor_group']) def test_create_node_specify_conductor_group_bad_version(self): - headers = {api_base.Version.string: '1.44'} + headers = {api_base.Version.string: '1.45'} ndict = test_api_utils.post_get_test_node(conductor_group='foo') response = self.post_json('/nodes', ndict, headers=headers, expect_errors=True) diff --git a/ironic/tests/unit/api/controllers/v1/test_utils.py b/ironic/tests/unit/api/controllers/v1/test_utils.py index af2a3fe09e..001b03857b 100644 --- a/ironic/tests/unit/api/controllers/v1/test_utils.py +++ b/ironic/tests/unit/api/controllers/v1/test_utils.py @@ -281,7 +281,7 @@ class TestApiUtils(base.TestCase): @mock.patch.object(pecan, 'request', spec_set=['version']) def test_check_allow_filter_by_conductor_group_fail(self, mock_request): - mock_request.version.minor = 44 + mock_request.version.minor = 45 self.assertRaises(exception.NotAcceptable, utils.check_allow_filter_by_conductor_group, 'foo')