[ironic] Ensure we test iterators when needed

Bug #2071972 brought it to light that we may have had some unit tests
improperly operating against lists, when generators are used by the SDK.
As a result of auditing remaining unit tests, this one instance was
found of improper testing. Fixing this should avoid future bugs like
2071972.

Related-Bug: #2071972
Change-Id: Icf9882f5f8421b150c308eb2502623f2fcb6cff6
This commit is contained in:
Jay Faulkner 2024-07-09 10:46:16 -07:00
parent 78ae23807c
commit ee3ec9b8f2

View File

@ -1093,7 +1093,7 @@ class IronicDriverTestCase(test.NoDBTestCase):
fake_resource = 'fake-resource'
self.mock_conn.get_node.return_value = node
# ensure cache gets populated without the node we want
self.mock_conn.nodes.return_value = [node_2]
self.mock_conn.nodes.return_value = iter([node_2])
mock_nr.return_value = fake_resource
result = self.driver.get_available_resource(node.id)