def test_allocate_node_conflict(self, mock_request, mock_get_url):
"""Test allocate resource conflict when compose node"""
mock_get_url.return_value = '/redfish/v1/Nodes'
# Fake response for getting nodes root
fake_node_root_resp = fakes.mock_request_get(fakes.fake_nodes_root(),
http_client.OK)
# Fake response for allocating node
fake_node_allocation_conflict = \
fakes.mock_request_get(fakes.fake_allocate_node_conflict(),
http_client.CONFLICT)
mock_request.side_effect = [fake_node_root_resp,
fake_node_allocation_conflict]
with self.assertRaises(exception.RedfishException) as context:
redfish.compose_node({"name": "test_node"})
self.assertTrue("There are no computer systems available for this "
"allocation request." in str(context.exception.detail))
评论列表
文章目录