def test_no_data(self): self.inspector.get_data.side_effect = ( ironic_inspector_client.ClientError(mock.Mock())) action = baremetal.ConfigureRootDeviceAction(node_uuid='MOCK_UUID', root_device='smallest') self.assertRaisesRegexp(exception.RootDeviceDetectionError, "No introspection data", action.run) self.assertEqual(self.ironic.node.update.call_count, 0)
def get_data(self, uuid): try: return self.data[uuid] except KeyError: raise ironic_inspector_client.ClientError(mock.Mock())
def get_status(self, uuid): try: return self.states[uuid] except KeyError: raise ironic_inspector_client.ClientError(mock.Mock())