Fix unit test for new fields in invaid API version
We should use newer API version than 1.7 for testing a case where a new node member is specified with an invalid API version. If version 1.1 (MIN) is used, any fields are not accepted because fields have been suppored from version 1.8. Version 1.1 doesn't test intended cases. Change-Id: I80e65b2eed799f0346463193dd31ccf8343a6a8d
This commit is contained in:
parent
a4d23f3230
commit
698ae4438b
@ -244,7 +244,7 @@ class TestListNodes(test_api_base.BaseApiTest):
|
||||
fields = 'network_interface'
|
||||
response = self.get_json(
|
||||
'/nodes/%s?fields=%s' % (node.uuid, fields),
|
||||
headers={api_base.Version.string: str(api_v1.MIN_VER)},
|
||||
headers={api_base.Version.string: str('1.19')},
|
||||
expect_errors=True)
|
||||
self.assertEqual(http_client.NOT_ACCEPTABLE, response.status_int)
|
||||
|
||||
@ -263,7 +263,7 @@ class TestListNodes(test_api_base.BaseApiTest):
|
||||
fields_arg = ','.join(api_utils.V31_FIELDS)
|
||||
response = self.get_json(
|
||||
'/nodes/%s?fields=%s' % (node.uuid, fields_arg),
|
||||
headers={api_base.Version.string: str(api_v1.MIN_VER)},
|
||||
headers={api_base.Version.string: '1.30'},
|
||||
expect_errors=True)
|
||||
self.assertEqual(http_client.NOT_ACCEPTABLE, response.status_int)
|
||||
|
||||
@ -283,7 +283,7 @@ class TestListNodes(test_api_base.BaseApiTest):
|
||||
fields = 'storage_interface'
|
||||
response = self.get_json(
|
||||
'/nodes/%s?fields=%s' % (node.uuid, fields),
|
||||
headers={api_base.Version.string: str(api_v1.MIN_VER)},
|
||||
headers={api_base.Version.string: '1.32'},
|
||||
expect_errors=True)
|
||||
self.assertEqual(http_client.NOT_ACCEPTABLE, response.status_int)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user