

@mock.patch.object(shade.OperatorCloud, 'ironic_client')
def test_list_nics(self, mock_client):
    port1 = fakes.FakeMachinePort(1, 'aa:bb:cc:dd', 'node1')
    port2 = fakes.FakeMachinePort(2, 'dd:cc:bb:aa', 'node2')
    port_list = [port1, port2]
    port_dict_list = meta.obj_list_to_dict(port_list)
    mock_client.port.list.return_value = port_list
    nics = self.cloud.list_nics()
    self.assertTrue(mock_client.port.list.called)
    self.assertEqual(port_dict_list, nics)

dataset/ETHPy150Open openstack-infra/shade/shade/tests/unit/test_shade_operator.py TestShadeOperator.test_list_nics/original