import pytest

from plateau.serialization._util import ensure_unicode_string_type


@pytest.mark.parametrize("obj,expected", [("tüst", "tüst"), ("tüst".encode(), "tüst")])
def test_ensure_unicode_string_types(obj, expected):
    actual = ensure_unicode_string_type(obj)
    assert isinstance(actual, str)
    assert actual == expected
