Merge "Ensure resource classes correctly"
This commit is contained in:
commit
ad47ff1c25
@ -207,7 +207,7 @@ class SchedulerReportClientTests(test.TestCase):
|
|||||||
# Try setting some invalid inventory and make sure the report
|
# Try setting some invalid inventory and make sure the report
|
||||||
# client raises the expected error.
|
# client raises the expected error.
|
||||||
inv_data = {
|
inv_data = {
|
||||||
'BAD_FOO': {
|
'CUSTOM_BOGU$_CLA$$': {
|
||||||
'total': 100,
|
'total': 100,
|
||||||
'reserved': 0,
|
'reserved': 0,
|
||||||
'min_unit': 1,
|
'min_unit': 1,
|
||||||
@ -279,17 +279,7 @@ class SchedulerReportClientTests(test.TestCase):
|
|||||||
}
|
}
|
||||||
with interceptor.RequestsInterceptor(app=self.app, url=self.url):
|
with interceptor.RequestsInterceptor(app=self.app, url=self.url):
|
||||||
self.client.update_compute_node(self.context, self.compute_node)
|
self.client.update_compute_node(self.context, self.compute_node)
|
||||||
# Simulate that our locally-running code has an outdated notion of
|
self.client.set_inventory_for_provider(
|
||||||
# standard resource classes.
|
|
||||||
with mock.patch.object(fields.ResourceClass, 'STANDARD',
|
|
||||||
('VCPU', 'MEMORY_MB', 'DISK_GB')):
|
|
||||||
# TODO(efried): Once bug #1746615 is fixed, this will no longer
|
|
||||||
# raise, and can be replaced with:
|
|
||||||
# self.client.set_inventory_for_provider(
|
|
||||||
# self.context, self.compute_uuid, self.compute_name, inv)
|
|
||||||
self.assertRaises(
|
|
||||||
exception.InvalidResourceClass,
|
|
||||||
self.client.set_inventory_for_provider,
|
|
||||||
self.context, self.compute_uuid, self.compute_name, inv)
|
self.context, self.compute_uuid, self.compute_name, inv)
|
||||||
|
|
||||||
@mock.patch('keystoneauth1.session.Session.get_endpoint',
|
@mock.patch('keystoneauth1.session.Session.get_endpoint',
|
||||||
|
Loading…
Reference in New Issue
Block a user