# Path: ironicclient/osc/plugin.py
# LOG = logging.getLogger(__name__)
# CLIENT_CLASS = 'ironicclient.v1.client.Client'
# API_VERSION_OPTION = 'os_baremetal_api_version'
# API_NAME = 'baremetal'
# LAST_KNOWN_API_VERSION = http.LAST_KNOWN_API_VERSION
# LATEST_VERSION = http.LATEST_VERSION
# API_VERSIONS = {
#     '1.%d' % i: CLIENT_CLASS
#     for i in range(1, LAST_KNOWN_API_VERSION + 1)
# }
# API_VERSIONS['1'] = CLIENT_CLASS
# OS_BAREMETAL_API_LATEST = True
#         OS_BAREMETAL_API_LATEST = False
#             OS_BAREMETAL_API_LATEST = True
#             OS_BAREMETAL_API_LATEST = False
# def make_client(instance):
# def build_option_parser(parser):
# def _get_environment_version(default):
#     def __call__(self, parser, namespace, values, option_string=None):
# class ReplaceLatestVersion(argparse.Action):
# 
# Path: ironicclient/tests/unit/osc/fakes.py
# AUTH_TOKEN = "foobar"
# AUTH_URL = "http://0.0.0.0"
# API_VERSION = '1.6'
# class FakeApp(object):
# class FakeClientManager(object):
# class FakeResource(object):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self, manager, info, loaded=False):
#     def _add_details(self, info):
#     def __repr__(self):
# 
# 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):


import argparse
import testtools
from unittest import mock
from ironicclient.osc import plugin
from ironicclient.tests.unit.osc import fakes
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.





class MakeClientTest(testtools.TestCase):

    @mock.patch.object(plugin, 'OS_BAREMETAL_API_LATEST', new=False)
    @mock.patch.object(client, 'Client', autospec=True)
    def test_make_client_explicit_version(self, mock_client):

# Path: ironicclient/osc/plugin.py
# LOG = logging.getLogger(__name__)
# CLIENT_CLASS = 'ironicclient.v1.client.Client'
# API_VERSION_OPTION = 'os_baremetal_api_version'
# API_NAME = 'baremetal'
# LAST_KNOWN_API_VERSION = http.LAST_KNOWN_API_VERSION
# LATEST_VERSION = http.LATEST_VERSION
# API_VERSIONS = {
#     '1.%d' % i: CLIENT_CLASS
#     for i in range(1, LAST_KNOWN_API_VERSION + 1)
# }
# API_VERSIONS['1'] = CLIENT_CLASS
# OS_BAREMETAL_API_LATEST = True
#         OS_BAREMETAL_API_LATEST = False
#             OS_BAREMETAL_API_LATEST = True
#             OS_BAREMETAL_API_LATEST = False
# def make_client(instance):
# def build_option_parser(parser):
# def _get_environment_version(default):
#     def __call__(self, parser, namespace, values, option_string=None):
# class ReplaceLatestVersion(argparse.Action):
# 
# Path: ironicclient/tests/unit/osc/fakes.py
# AUTH_TOKEN = "foobar"
# AUTH_URL = "http://0.0.0.0"
# API_VERSION = '1.6'
# class FakeApp(object):
# class FakeClientManager(object):
# class FakeResource(object):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self, manager, info, loaded=False):
#     def _add_details(self, info):
#     def __repr__(self):
# 
# 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/osc/test_plugin.py
import argparse
import testtools
from unittest import mock
from ironicclient.osc import plugin
from ironicclient.tests.unit.osc import fakes
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.





class MakeClientTest(testtools.TestCase):

    @mock.patch.object(plugin, 'OS_BAREMETAL_API_LATEST', new=False)
    @mock.patch.object(client, 'Client', autospec=True)
    def test_make_client_explicit_version(self, mock_client):

        instance = fakes.FakeClientManager()