python-opentsdbclient/opentsdbclient/tests/test_client.py

29 lines
1.1 KiB
Python

# Copyright 2014: Mirantis Inc.
# All Rights Reserved.
#
# 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.
from opentsdbclient import client
from opentsdbclient.rest import client as rest_cl
from opentsdbclient.socket import client as socket_cl
from opentsdbclient import tests
class ClientTest(tests.BaseTestCase):
def test_get_client(self):
r_cl = client.get_client((self.host, self.port), protocol='rest')
s_cl = client.get_client((self.host, self.port), protocol='socket')
self.assertIsInstance(r_cl, rest_cl.RESTOpenTSDBClient)
self.assertIsInstance(s_cl, socket_cl.SocketOpenTSDBClient)