# Path: osprofiler/drivers/base.py
# LOG = logging.getLogger(__name__)
# def get_driver(connection_string, *args, **kwargs):
#     def __init__(self, connection_str, project=None, service=None, host=None,
#                  **kwargs):
#     def notify(self, info, **kwargs):
#     def get_report(self, base_id):
#     def get_name(cls):
#     def list_traces(self, fields=None):
#     def list_error_traces(self):
#     def _build_tree(nodes):
#     def _append_results(self, trace_id, parent_id, name, project, service,
#                         host, timestamp, raw_payload=None):
#     def _parse_results(self):
#         def msec(dt):
# class Driver(object):
# 
# Path: osprofiler/tests/test.py
# class TestCase(testcase.TestCase):
# class FunctionalTestCase(TestCase):
#     def setUp(self):


from osprofiler.drivers import base
from osprofiler.tests import test

        class B(base.Driver):

            def __init__(self, c_str, a, b=10):
                self.a = a
                self.b = b

            @classmethod
            def get_name(cls):
                return "b"

            def notify(self, c):
                return self.a + self.b + c

        self.assertEqual(22, base.get_driver("b://", 5, b=7).notify(10))

    def test_driver_not_found(self):
        self.assertRaises(ValueError, base.get_driver,
                          "Driver not found for connection string: "
                          "nonexisting://")

    def test_build_empty_tree(self):
        class C(base.Driver):
            @classmethod
            def get_name(cls):
                return "c"

        self.assertEqual([], base.get_driver("c://")._build_tree({}))

    def test_build_complex_tree(self):

# Path: osprofiler/drivers/base.py
# LOG = logging.getLogger(__name__)
# def get_driver(connection_string, *args, **kwargs):
#     def __init__(self, connection_str, project=None, service=None, host=None,
#                  **kwargs):
#     def notify(self, info, **kwargs):
#     def get_report(self, base_id):
#     def get_name(cls):
#     def list_traces(self, fields=None):
#     def list_error_traces(self):
#     def _build_tree(nodes):
#     def _append_results(self, trace_id, parent_id, name, project, service,
#                         host, timestamp, raw_payload=None):
#     def _parse_results(self):
#         def msec(dt):
# class Driver(object):
# 
# Path: osprofiler/tests/test.py
# class TestCase(testcase.TestCase):
# class FunctionalTestCase(TestCase):
#     def setUp(self):


# Path: osprofiler/tests/unit/drivers/test_base.py
from osprofiler.drivers import base
from osprofiler.tests import test


        class B(base.Driver):

            def __init__(self, c_str, a, b=10):
                self.a = a
                self.b = b

            @classmethod
            def get_name(cls):
                return "b"

            def notify(self, c):
                return self.a + self.b + c

        self.assertEqual(22, base.get_driver("b://", 5, b=7).notify(10))

    def test_driver_not_found(self):
        self.assertRaises(ValueError, base.get_driver,
                          "Driver not found for connection string: "
                          "nonexisting://")

    def test_build_empty_tree(self):
        class C(base.Driver):
            @classmethod
            def get_name(cls):
                return "c"

        self.assertEqual([], base.get_driver("c://")._build_tree({}))

    def test_build_complex_tree(self):

        class D(base.Driver):