

@mock.patch.object(shade.OperatorCloud, 'ironic_client')
def test_list_machines(self, mock_client):
    m1 = fakes.FakeMachine(1, 'fake_machine1')
    mock_client.node.list.return_value = [m1]
    machines = self.cloud.list_machines()
    self.assertTrue(mock_client.node.list.called)
    self.assertEqual(meta.obj_to_dict(m1), machines[0])

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