python utility to manage a tripleo based cloud
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
2.1 KiB

# Copyright 2015 Red Hat, Inc.
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from unittest import mock
import ironic_inspector_client
from osc_lib.tests import utils
class FakeInspectorClient(object):
def __init__(self, states=None, data=None):
self.states = states or {} = data or {}
self.on_introspection = []
def introspect(self, uuid):
def get_status(self, uuid):
return self.states[uuid]
except KeyError:
raise ironic_inspector_client.ClientError(mock.Mock())
def get_data(self, uuid):
except KeyError:
raise ironic_inspector_client.ClientError(mock.Mock())
def wait_for_finish(self, uuids):
return {uuid: self.states[uuid] for uuid in uuids}
class ClientWrapper(object):
def __init__(self):
self._instance = None
class TestBaremetal(utils.TestCommand):
def setUp(self):
super(TestBaremetal, self).setUp() = mock.Mock(auth_token="TOKEN") = mock.Mock() = mock.Mock() = FakeInspectorClient() = "Arcadia" = mock.Mock() = mock.Mock() = ClientWrapper()
def tearDown(self):
super(TestBaremetal, self).tearDown()