# Path: osprofiler/_utils.py
# def split(text, strip=True):
# def binary_encode(text, encoding="utf-8"):
# def binary_decode(data, encoding="utf-8"):
# def generate_hmac(data, hmac_key):
# def signed_pack(data, hmac_key):
# def signed_unpack(data, hmac_data, hmac_keys):
# def itersubclasses(cls, _seen=None):
# def import_modules_from_package(package):
# def shorten_id(span_id):
# 
# Path: osprofiler/tests/test.py
# class TestCase(testcase.TestCase):
# class FunctionalTestCase(TestCase):
#     def setUp(self):


import base64
import hashlib
import hmac
import uuid
from unittest import mock
from osprofiler import _utils as utils
from osprofiler.tests import test
# 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 UtilsTestCase(test.TestCase):

    def test_split(self):
        self.assertEqual([1, 2], utils.split([1, 2]))
        self.assertEqual(["A", "B"], utils.split("A, B"))
        self.assertEqual(["A", " B"], utils.split("A, B", strip=False))

    def test_split_wrong_type(self):
        self.assertRaises(TypeError, utils.split, 1)

    def test_binary_encode_and_decode(self):
        self.assertEqual("text",

# Path: osprofiler/_utils.py
# def split(text, strip=True):
# def binary_encode(text, encoding="utf-8"):
# def binary_decode(data, encoding="utf-8"):
# def generate_hmac(data, hmac_key):
# def signed_pack(data, hmac_key):
# def signed_unpack(data, hmac_data, hmac_keys):
# def itersubclasses(cls, _seen=None):
# def import_modules_from_package(package):
# def shorten_id(span_id):
# 
# Path: osprofiler/tests/test.py
# class TestCase(testcase.TestCase):
# class FunctionalTestCase(TestCase):
#     def setUp(self):


# Path: osprofiler/tests/unit/test_utils.py
import base64
import hashlib
import hmac
import uuid
from unittest import mock
from osprofiler import _utils as utils
from osprofiler.tests import test

# 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 UtilsTestCase(test.TestCase):

    def test_split(self):
        self.assertEqual([1, 2], utils.split([1, 2]))
        self.assertEqual(["A", "B"], utils.split("A, B"))
        self.assertEqual(["A", " B"], utils.split("A, B", strip=False))

    def test_split_wrong_type(self):
        self.assertRaises(TypeError, utils.split, 1)

    def test_binary_encode_and_decode(self):
        self.assertEqual("text",

                         utils.binary_decode(utils.binary_encode("text")))