# Path: transmute_core/object_serializers/primitive_serializer.py
# class BoolSerializer:
#     def can_handle(self, cls):
#         return issubclass(cls, bool)
# 
#     @staticmethod
#     def to_json_schema(cls):
#         return {"type": "boolean"}
# 
#     @staticmethod
#     def load(cls, obj):
#         if isinstance(obj, string_type):
#             return obj.lower().startswith("t")
#         return bool(obj)
# 
#     @staticmethod
#     def dump(cls, obj):
#         return obj


from ...object_serializers.primitive_serializer import BoolSerializer
import pytest


@pytest.mark.parametrize(
    "object, result",
    [
        ("true", True),
        ("false", False),
        ("some_other_str", False),
        ([], False),
        (["non-empty-list"], True),
        ({}, False),
        ({"non_empty_dict": "test_val"}, True),
    ],
)
def test_primitive_serializer_bool_serializer(object, result):
    serializer = BoolSerializer()

# Path: transmute_core/object_serializers/primitive_serializer.py
# class BoolSerializer:
#     def can_handle(self, cls):
#         return issubclass(cls, bool)
# 
#     @staticmethod
#     def to_json_schema(cls):
#         return {"type": "boolean"}
# 
#     @staticmethod
#     def load(cls, obj):
#         if isinstance(obj, string_type):
#             return obj.lower().startswith("t")
#         return bool(obj)
# 
#     @staticmethod
#     def dump(cls, obj):
#         return obj


# Path: transmute_core/tests/object_serializers/test_primitive_serializer.py
from ...object_serializers.primitive_serializer import BoolSerializer
import pytest



@pytest.mark.parametrize(
    "object, result",
    [
        ("true", True),
        ("false", False),
        ("some_other_str", False),
        ([], False),
        (["non-empty-list"], True),
        ({}, False),
        ({"non_empty_dict": "test_val"}, True),
    ],
)
def test_primitive_serializer_bool_serializer(object, result):
    serializer = BoolSerializer()

    assert BoolSerializer.load(serializer, object) == result