# Path: ironicclient/common/filecache.py
# LOG = logging.getLogger(__name__)
# AUTHOR = 'openstack'
# PROGNAME = 'python-ironicclient'
# CACHE = None
# CACHE_DIR = appdirs.user_cache_dir(PROGNAME, AUTHOR)
# CACHE_EXPIRY_ENV_VAR = 'IRONICCLIENT_CACHE_EXPIRY'  # environment variable
# CACHE_FILENAME = os.path.join(CACHE_DIR, 'ironic-api-version.dbm')
# DEFAULT_EXPIRY = 300  # seconds
#         CACHE = dogpile.cache.make_region(key_mangler=str).configure(
#             'dogpile.cache.dbm',
#             expiration_time=expiry_time,
#             arguments={
#                 "filename": CACHE_FILENAME,
#             }
#         )
# def _get_cache():
# def _build_key(host, port):
# def save_data(host, port, data):
# def retrieve_data(host, port, expiry=None):
# 
# Path: ironicclient/common/http.py
# DEFAULT_VER = '1.9'
# LAST_KNOWN_API_VERSION = 78
# LATEST_VERSION = '1.{}'.format(LAST_KNOWN_API_VERSION)
# LOG = logging.getLogger(__name__)
# USER_AGENT = 'python-ironicclient'
# CHUNKSIZE = 1024 * 64  # 64kB
# _MAJOR_VERSION = 1
# API_VERSION = '/v%d' % _MAJOR_VERSION
# API_VERSION_SELECTED_STATES = ('user', 'negotiated', 'cached', 'default')
# DEFAULT_MAX_RETRIES = 5
# DEFAULT_RETRY_INTERVAL = 2
# SENSITIVE_HEADERS = ('X-Auth-Token',)
# SUPPORTED_ENDPOINT_SCHEME = ('http', 'https')
# _API_VERSION_RE = re.compile(r'/+(v%d)?/*$' % _MAJOR_VERSION)
# _RETRY_EXCEPTIONS = (exc.Conflict, exc.ServiceUnavailable,
#                      exc.ConnectionRefused, kexc.RetriableConnectionFailure)
# def _trim_endpoint_api_version(url):
# def _extract_error_json(body):
# def get_server(url):
#     def negotiate_version(self, conn, resp):
#         def _query_server(conn):
#     def _generic_parse_version_headers(self, accessor_func):
#     def _parse_version_headers(self, accessor_func):
#     def _make_simple_request(self, conn, method, url):
#     def _must_negotiate_version(self):
# def with_retries(func):
#     def wrapper(self, url, method, **kwargs):
#     def __init__(self,
#                  os_ironic_api_version,
#                  api_version_select_state,
#                  max_retries,
#                  retry_interval,
#                  **kwargs):
#     def _parse_version_headers(self, resp):
#     def _get_endpoint_filter(self):
#     def _make_simple_request(self, conn, method, url):
#     def _http_request(self, url, method, **kwargs):
#     def json_request(self, method, url, **kwargs):
#     def raw_request(self, method, url, **kwargs):
# def _construct_http_client(session,
#                            token=None,
#                            auth_ref=None,
#                            os_ironic_api_version=DEFAULT_VER,
#                            api_version_select_state='default',
#                            max_retries=DEFAULT_MAX_RETRIES,
#                            retry_interval=DEFAULT_RETRY_INTERVAL,
#                            timeout=600,
#                            ca_file=None,
#                            cert_file=None,
#                            key_file=None,
#                            insecure=None,
#                            **kwargs):
# class VersionNegotiationMixin(object):
# class SessionClient(VersionNegotiationMixin, adapter.LegacyJsonAdapter):
# 
# 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/v1/client.py
# LOG = logging.getLogger(__name__)
# class Client(object):
#     def __init__(self, endpoint_override=None, *args, **kwargs):
#     def current_api_version(self):
#     def is_api_version_negotiated(self):
#     def negotiate_api_version(self):


from unittest import mock
from ironicclient.common import filecache
from ironicclient.common import http
from ironicclient.tests.unit import utils
from ironicclient.v1 import client
#    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
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    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.




@mock.patch.object(http, '_construct_http_client', autospec=True)
class ClientTest(utils.BaseTestCase):

    session = mock.sentinel.session

    def test_client_user_api_version(self, http_client_mock):
        endpoint = 'http://ironic:6385'
        os_ironic_api_version = '1.15'


# Path: ironicclient/common/filecache.py
# LOG = logging.getLogger(__name__)
# AUTHOR = 'openstack'
# PROGNAME = 'python-ironicclient'
# CACHE = None
# CACHE_DIR = appdirs.user_cache_dir(PROGNAME, AUTHOR)
# CACHE_EXPIRY_ENV_VAR = 'IRONICCLIENT_CACHE_EXPIRY'  # environment variable
# CACHE_FILENAME = os.path.join(CACHE_DIR, 'ironic-api-version.dbm')
# DEFAULT_EXPIRY = 300  # seconds
#         CACHE = dogpile.cache.make_region(key_mangler=str).configure(
#             'dogpile.cache.dbm',
#             expiration_time=expiry_time,
#             arguments={
#                 "filename": CACHE_FILENAME,
#             }
#         )
# def _get_cache():
# def _build_key(host, port):
# def save_data(host, port, data):
# def retrieve_data(host, port, expiry=None):
# 
# Path: ironicclient/common/http.py
# DEFAULT_VER = '1.9'
# LAST_KNOWN_API_VERSION = 78
# LATEST_VERSION = '1.{}'.format(LAST_KNOWN_API_VERSION)
# LOG = logging.getLogger(__name__)
# USER_AGENT = 'python-ironicclient'
# CHUNKSIZE = 1024 * 64  # 64kB
# _MAJOR_VERSION = 1
# API_VERSION = '/v%d' % _MAJOR_VERSION
# API_VERSION_SELECTED_STATES = ('user', 'negotiated', 'cached', 'default')
# DEFAULT_MAX_RETRIES = 5
# DEFAULT_RETRY_INTERVAL = 2
# SENSITIVE_HEADERS = ('X-Auth-Token',)
# SUPPORTED_ENDPOINT_SCHEME = ('http', 'https')
# _API_VERSION_RE = re.compile(r'/+(v%d)?/*$' % _MAJOR_VERSION)
# _RETRY_EXCEPTIONS = (exc.Conflict, exc.ServiceUnavailable,
#                      exc.ConnectionRefused, kexc.RetriableConnectionFailure)
# def _trim_endpoint_api_version(url):
# def _extract_error_json(body):
# def get_server(url):
#     def negotiate_version(self, conn, resp):
#         def _query_server(conn):
#     def _generic_parse_version_headers(self, accessor_func):
#     def _parse_version_headers(self, accessor_func):
#     def _make_simple_request(self, conn, method, url):
#     def _must_negotiate_version(self):
# def with_retries(func):
#     def wrapper(self, url, method, **kwargs):
#     def __init__(self,
#                  os_ironic_api_version,
#                  api_version_select_state,
#                  max_retries,
#                  retry_interval,
#                  **kwargs):
#     def _parse_version_headers(self, resp):
#     def _get_endpoint_filter(self):
#     def _make_simple_request(self, conn, method, url):
#     def _http_request(self, url, method, **kwargs):
#     def json_request(self, method, url, **kwargs):
#     def raw_request(self, method, url, **kwargs):
# def _construct_http_client(session,
#                            token=None,
#                            auth_ref=None,
#                            os_ironic_api_version=DEFAULT_VER,
#                            api_version_select_state='default',
#                            max_retries=DEFAULT_MAX_RETRIES,
#                            retry_interval=DEFAULT_RETRY_INTERVAL,
#                            timeout=600,
#                            ca_file=None,
#                            cert_file=None,
#                            key_file=None,
#                            insecure=None,
#                            **kwargs):
# class VersionNegotiationMixin(object):
# class SessionClient(VersionNegotiationMixin, adapter.LegacyJsonAdapter):
# 
# 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/v1/client.py
# LOG = logging.getLogger(__name__)
# class Client(object):
#     def __init__(self, endpoint_override=None, *args, **kwargs):
#     def current_api_version(self):
#     def is_api_version_negotiated(self):
#     def negotiate_api_version(self):


# Path: ironicclient/tests/unit/v1/test_client.py
from unittest import mock
from ironicclient.common import filecache
from ironicclient.common import http
from ironicclient.tests.unit import utils
from ironicclient.v1 import client

#    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
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    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.




@mock.patch.object(http, '_construct_http_client', autospec=True)
class ClientTest(utils.BaseTestCase):

    session = mock.sentinel.session

    def test_client_user_api_version(self, http_client_mock):
        endpoint = 'http://ironic:6385'
        os_ironic_api_version = '1.15'


        client.Client(endpoint, session=self.session,