# Path: ironicclient/exc.py
# class AmbiguousAuthSystem(exceptions.ClientException):
# class InvalidAttribute(exceptions.ClientException):
# class StateTransitionFailed(exceptions.ClientException):
# class StateTransitionTimeout(exceptions.ClientException):
# def from_response(response, message=None, traceback=None, method=None,
#                   url=None):
# 
# Path: ironicclient/tests/unit/utils.py
# class BaseTestCase(testtools.TestCase):
# class FakeAPI(object):
# class FakeConnection(object):
# class FakeResponse(object):
#     def setUp(self):
#     def __init__(self, responses, path_prefix=None):
#     def _request(self, method, url, headers=None, body=None, params=None):
#     def raw_request(self, *args, **kwargs):
#     def json_request(self, *args, **kwargs):
#     def __init__(self, response=None, path_prefix=None):
#     def request(self, method, conn_url, **kwargs):
#     def setresponse(self, response):
#     def getresponse(self):
#     def __repr__(self):
#     def __init__(self, headers, body=None, version=None, status=None,
#                  reason=None, request_headers={}):
#     def getheaders(self):
#     def getheader(self, key, default):
#     def read(self, amt):
#     def __repr__(self):
# def mockSessionResponse(headers, content=None, status_code=None, version=None,
#                         request_headers={}):
# def mockSession(headers, content=None, status_code=None, version=None):


import copy
import testtools
import ironicclient.v1.port
from ironicclient import exc
from ironicclient.tests.unit import utils
    '/v1/volume/connectors/?sort_dir=desc':
    {
        'GET': (
            {},
            {"connectors": [CONNECTOR2, CONNECTOR1]}
        ),
    },
}


class VolumeConnectorManagerTestBase(testtools.TestCase):

    def _validate_obj(self, expect, obj):
        self.assertEqual(expect['uuid'], obj.uuid)
        self.assertEqual(expect['type'], obj.type)
        self.assertEqual(expect['connector_id'], obj.connector_id)
        self.assertEqual(expect['node_uuid'], obj.node_uuid)

    def _validate_list(self, expect_request,
                       expect_connectors, actual_connectors):
        self.assertEqual(expect_request, self.api.calls)
        self.assertEqual(len(expect_connectors), len(actual_connectors))
        for expect, obj in zip(expect_connectors, actual_connectors):
            self._validate_obj(expect, obj)


class VolumeConnectorManagerTest(VolumeConnectorManagerTestBase):

    def setUp(self):
        super(VolumeConnectorManagerTest, self).setUp()

# Path: ironicclient/exc.py
# class AmbiguousAuthSystem(exceptions.ClientException):
# class InvalidAttribute(exceptions.ClientException):
# class StateTransitionFailed(exceptions.ClientException):
# class StateTransitionTimeout(exceptions.ClientException):
# def from_response(response, message=None, traceback=None, method=None,
#                   url=None):
# 
# Path: ironicclient/tests/unit/utils.py
# class BaseTestCase(testtools.TestCase):
# class FakeAPI(object):
# class FakeConnection(object):
# class FakeResponse(object):
#     def setUp(self):
#     def __init__(self, responses, path_prefix=None):
#     def _request(self, method, url, headers=None, body=None, params=None):
#     def raw_request(self, *args, **kwargs):
#     def json_request(self, *args, **kwargs):
#     def __init__(self, response=None, path_prefix=None):
#     def request(self, method, conn_url, **kwargs):
#     def setresponse(self, response):
#     def getresponse(self):
#     def __repr__(self):
#     def __init__(self, headers, body=None, version=None, status=None,
#                  reason=None, request_headers={}):
#     def getheaders(self):
#     def getheader(self, key, default):
#     def read(self, amt):
#     def __repr__(self):
# def mockSessionResponse(headers, content=None, status_code=None, version=None,
#                         request_headers={}):
# def mockSession(headers, content=None, status_code=None, version=None):


# Path: ironicclient/tests/unit/v1/test_volume_connector.py
import copy
import testtools
import ironicclient.v1.port
from ironicclient import exc
from ironicclient.tests.unit import utils

    '/v1/volume/connectors/?sort_dir=desc':
    {
        'GET': (
            {},
            {"connectors": [CONNECTOR2, CONNECTOR1]}
        ),
    },
}


class VolumeConnectorManagerTestBase(testtools.TestCase):

    def _validate_obj(self, expect, obj):
        self.assertEqual(expect['uuid'], obj.uuid)
        self.assertEqual(expect['type'], obj.type)
        self.assertEqual(expect['connector_id'], obj.connector_id)
        self.assertEqual(expect['node_uuid'], obj.node_uuid)

    def _validate_list(self, expect_request,
                       expect_connectors, actual_connectors):
        self.assertEqual(expect_request, self.api.calls)
        self.assertEqual(len(expect_connectors), len(actual_connectors))
        for expect, obj in zip(expect_connectors, actual_connectors):
            self._validate_obj(expect, obj)


class VolumeConnectorManagerTest(VolumeConnectorManagerTestBase):

    def setUp(self):
        super(VolumeConnectorManagerTest, self).setUp()

        self.api = utils.FakeAPI(fake_responses)