# Path: tests/utils/misc.py
# def is_unicode_string(value):
#     """
#     Return ``True``, if ``value`` is of a real unicode string type
#     (``unicode`` in python 2, ``str`` in python 3), ``False`` otherwise.
#     """
#     return isinstance(value, str)


import sys
import pytest
    import os
    import select
    import signal
from hypothesis import given, settings, strategies
from pyudev import Context, _util
from .utils import is_unicode_string
    from unittest.mock import Mock
    from mock import Mock
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

# isort: FUTURE
from __future__ import absolute_import, division, print_function, unicode_literals

# isort: STDLIB

# isort: THIRDPARTY

# isort: LOCAL


try:
    # isort: STDLIB
except ImportError:
    # isort: THIRDPARTY


_CONTEXT = Context()


@pytest.mark.conversion
def test_ensure_byte_string():
    assert isinstance(_util.ensure_byte_string("hello world"), bytes)
    assert _util.ensure_byte_string("hello world") == b"hello world"
    hello = b"hello world"
    assert _util.ensure_byte_string(hello) is hello


@pytest.mark.conversion

# Path: tests/utils/misc.py
# def is_unicode_string(value):
#     """
#     Return ``True``, if ``value`` is of a real unicode string type
#     (``unicode`` in python 2, ``str`` in python 3), ``False`` otherwise.
#     """
#     return isinstance(value, str)


# Path: tests/test_util.py
import sys
import pytest
    import os
    import select
    import signal
from hypothesis import given, settings, strategies
from pyudev import Context, _util
from .utils import is_unicode_string
    from unittest.mock import Mock
    from mock import Mock

# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

# isort: FUTURE
from __future__ import absolute_import, division, print_function, unicode_literals

# isort: STDLIB

# isort: THIRDPARTY

# isort: LOCAL


try:
    # isort: STDLIB
except ImportError:
    # isort: THIRDPARTY


_CONTEXT = Context()


@pytest.mark.conversion
def test_ensure_byte_string():
    assert isinstance(_util.ensure_byte_string("hello world"), bytes)
    assert _util.ensure_byte_string("hello world") == b"hello world"
    hello = b"hello world"
    assert _util.ensure_byte_string(hello) is hello


@pytest.mark.conversion

def test_ensure_byte_string_none():