# Path: zaqarclient/errors.py
# class ZaqarError(Exception):
# class DriverLoadFailure(ZaqarError):
# class InvalidOperation(ZaqarError):
# class UnsupportedVersion(ZaqarError):
#     def __init__(self, driver, ex):
# 
# Path: zaqarclient/queues/client.py
# _CLIENTS = {1: cv1.Client,
#             1.1: cv1.Client,
#             2: cv2.Client}
# def Client(url=None, version=None, conf=None, session=None):
# 
# Path: zaqarclient/tests/base.py
# _USE_AUTHENTICATION = os.environ.get('ZAQARCLIENT_AUTH_FUNCTIONAL', False)
# _RUN_FUNCTIONAL = os.environ.get('ZAQARCLIENT_TEST_FUNCTIONAL',
#                                  _USE_AUTHENTICATION)
# class TestBase(testtools.TestCase):
#     def setUp(self):
#     def _credentials(self, cloud='devstack-admin'):
#     def _setup_auth_params(self):
#     def config(self, group=None, **kw):


import zaqarclient
from zaqarclient import errors
from zaqarclient.queues import client
from zaqarclient.tests import base
# Copyright (c) 2013 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
#
#    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 TestClient(base.TestBase):

    def test_get_instance(self):
        version = list(client._CLIENTS.keys())[0]
        cli = client.Client('http://example.com',
                            version, {})
        self.assertIsInstance(cli,
                              client._CLIENTS[version])

    def test_version_failure(self):
        self.assertRaises(errors.ZaqarError,

# Path: zaqarclient/errors.py
# class ZaqarError(Exception):
# class DriverLoadFailure(ZaqarError):
# class InvalidOperation(ZaqarError):
# class UnsupportedVersion(ZaqarError):
#     def __init__(self, driver, ex):
# 
# Path: zaqarclient/queues/client.py
# _CLIENTS = {1: cv1.Client,
#             1.1: cv1.Client,
#             2: cv2.Client}
# def Client(url=None, version=None, conf=None, session=None):
# 
# Path: zaqarclient/tests/base.py
# _USE_AUTHENTICATION = os.environ.get('ZAQARCLIENT_AUTH_FUNCTIONAL', False)
# _RUN_FUNCTIONAL = os.environ.get('ZAQARCLIENT_TEST_FUNCTIONAL',
#                                  _USE_AUTHENTICATION)
# class TestBase(testtools.TestCase):
#     def setUp(self):
#     def _credentials(self, cloud='devstack-admin'):
#     def _setup_auth_params(self):
#     def config(self, group=None, **kw):


# Path: tests/unit/queues/test_client.py
import zaqarclient
from zaqarclient import errors
from zaqarclient.queues import client
from zaqarclient.tests import base

# Copyright (c) 2013 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
#
#    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 TestClient(base.TestBase):

    def test_get_instance(self):
        version = list(client._CLIENTS.keys())[0]
        cli = client.Client('http://example.com',
                            version, {})
        self.assertIsInstance(cli,
                              client._CLIENTS[version])

    def test_version_failure(self):
        self.assertRaises(errors.ZaqarError,

                          client.Client,