# Path: osprofiler/sqlalchemy.py
# LOG = log.getLogger(__name__)
# _DISABLED = False
#     _DISABLED = True
#     _DISABLED = False
# def disable():
# def enable():
# def add_tracing(sqlalchemy, engine, name, hide_result=True):
# def wrap_session(sqlalchemy, sess):
# def _before_cursor_execute(name):
#     def handler(conn, cursor, statement, params, context, executemany):
# def _after_cursor_execute(hide_result=True):
#     def handler(conn, cursor, statement, params, context, executemany):
# def handle_error(exception_context):
# 
# Path: osprofiler/tests/test.py
# class TestCase(testcase.TestCase):
# class FunctionalTestCase(TestCase):
#     def setUp(self):


import contextlib
from unittest import mock
from osprofiler import sqlalchemy
from osprofiler.tests import test
# 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.





class SqlalchemyTracingTestCase(test.TestCase):

    @mock.patch("osprofiler.sqlalchemy.profiler")
    def test_before_execute(self, mock_profiler):

# Path: osprofiler/sqlalchemy.py
# LOG = log.getLogger(__name__)
# _DISABLED = False
#     _DISABLED = True
#     _DISABLED = False
# def disable():
# def enable():
# def add_tracing(sqlalchemy, engine, name, hide_result=True):
# def wrap_session(sqlalchemy, sess):
# def _before_cursor_execute(name):
#     def handler(conn, cursor, statement, params, context, executemany):
# def _after_cursor_execute(hide_result=True):
#     def handler(conn, cursor, statement, params, context, executemany):
# def handle_error(exception_context):
# 
# Path: osprofiler/tests/test.py
# class TestCase(testcase.TestCase):
# class FunctionalTestCase(TestCase):
#     def setUp(self):


# Path: osprofiler/tests/unit/test_sqlalchemy.py
import contextlib
from unittest import mock
from osprofiler import sqlalchemy
from osprofiler.tests import test

# 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.





class SqlalchemyTracingTestCase(test.TestCase):

    @mock.patch("osprofiler.sqlalchemy.profiler")
    def test_before_execute(self, mock_profiler):

        handler = sqlalchemy._before_cursor_execute("sql")