1
# -*- encoding: utf-8 -*-
3
# Copyright © 2014 Intel Corp
5
# Authors: Lianhao Lu <lianhao.lu@intel.com>
7
# Licensed under the Apache License, Version 2.0 (the "License"); you may
8
# not use this file except in compliance with the License. You may obtain
9
# a copy of the License at
11
# http://www.apache.org/licenses/LICENSE-2.0
13
# Unless required by applicable law or agreed to in writing, software
14
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16
# License for the specific language governing permissions and limitations
19
from ceilometer.hardware import inspector
20
from ceilometer.openstack.common import network_utils
21
from ceilometer.tests import base
24
class TestHardwareInspector(base.BaseTestCase):
25
def test_get_inspector(self):
26
url = network_utils.urlsplit("snmp://")
27
driver = inspector.get_inspector(url)
28
self.assertTrue(driver)
30
def test_get_inspector_illegal(self):
31
url = network_utils.urlsplit("illegal://")
32
self.assertRaises(RuntimeError,
33
inspector.get_inspector,