# Path: tests/entities.py
# A = TypeVar('A')
# class DataClassWithDecimal(DataClassJsonMixin):
# class DataClassWithNewType(DataClassJsonMixin):
# class DataClassWithNestedNewType(DataClassJsonMixin):
# class DataClassWithList(DataClassJsonMixin):
# class DataClassWithListDefaultFactory(DataClassJsonMixin):
# class DataClassWithListStr(DataClassJsonMixin):
# class DataClassWithDict(DataClassJsonMixin):
# class DataClassWithDictInt(DataClassJsonMixin):
# class DataClassWithDictDefaultFactory(DataClassJsonMixin):
# class DataClassWithSet(DataClassJsonMixin):
# class DataClassWithTuple(DataClassJsonMixin):
# class DataClassWithFrozenSet(DataClassJsonMixin):
# class DataClassWithDeque(DataClassJsonMixin):
# class DataClassWithOptional(DataClassJsonMixin):
# class DataClassWithOptionalStr(DataClassJsonMixin):
# class DataClassWithOptionalNested(DataClassJsonMixin):
# class DataClassWithUnionIntNone(DataClassJsonMixin):
# class DataClassWithDataClass(DataClassJsonMixin):
# class DataClassX(DataClassJsonMixin):
# class DataClassXs(DataClassJsonMixin):
# class DataClassIntImmutableDefault(DataClassJsonMixin):
# class DataClassBoolImmutableDefault(DataClassJsonMixin):
# class DataClassMutableDefaultList(DataClassJsonMixin):
# class DataClassMutableDefaultDict(DataClassJsonMixin):
# class MyCollection(Collection[A]):
# class DataClassWithMyCollection(DataClassJsonMixin):
# class DataClassJsonDecorator:
# class DataClassWithConfigManual:
# class DataClassWithConfigHelper:
# class DataClassWithConfigDecorator:
# class DataClassWithUuid:
# class DataClassDefaultListStr:
# class DataClassChild:
# class DataClassDefaultOptionalList:
# class DataClassList:
# class DataClassOptional:
# class DataClassWithOptionalDatetime:
# class DataClassWithOptionalDecimal:
# class DataClassWithOptionalUuid:
# class DataClassWithNestedAny:
# class DataClassWithNestedOptionalAny:
# class DataClassWithNestedOptional:
# class DataClassWithNestedDictWithTupleKeys:
#     def __init__(self, xs: Collection[A]) -> None:
#     def __contains__(self, item):
#     def __iter__(self):
#     def __len__(self):
#     def __eq__(self, other):


import sys
import pytest
from datetime import datetime, timezone
from decimal import Decimal
from uuid import UUID
from tests.entities import (DataClassBoolImmutableDefault,
                            DataClassIntImmutableDefault,
                            DataClassJsonDecorator,
                            DataClassWithConfigDecorator,
                            DataClassWithConfigHelper,
                            DataClassWithConfigManual, DataClassWithDataClass,
                            DataClassWithDecimal, DataClassWithList,
                            DataClassWithNestedNewType, DataClassWithNewType,
                            DataClassWithOptional,
                            DataClassWithOptionalDatetime,
                            DataClassWithOptionalDecimal,
                            DataClassWithOptionalNested,
                            DataClassWithOptionalUuid, DataClassWithUuid, UUIDWrapper,
                            UUIDWrapperWrapper)
        assert dumped == json_s

    def test_loads_many(self):
        json_s = '[{"xs": [1]}]'
        assert (DataClassWithList.schema().loads(json_s, many=True)
                == [DataClassWithList([1])])

    def test_loads_many_nested(self):
        json_s = '[{"dc_with_list": {"xs": [1]}}]'
        assert (DataClassWithDataClass.schema().loads(json_s, many=True)
                == [DataClassWithDataClass(DataClassWithList([1]))])

    def test_loads_default(self):
        assert (DataClassIntImmutableDefault.schema().loads('{}')
                == DataClassIntImmutableDefault())
        assert (DataClassBoolImmutableDefault.schema().loads('{}')
                == DataClassBoolImmutableDefault())

    def test_loads_default_many(self):
        assert (DataClassIntImmutableDefault.schema().loads('[{}]', many=True)
                == [DataClassIntImmutableDefault()])
        assert (DataClassBoolImmutableDefault.schema().loads('[{}]', many=True)
                == [DataClassBoolImmutableDefault()])

    def test_dumps_default(self):
        d_int = DataClassIntImmutableDefault()
        assert d_int.x == 0
        assert DataClassIntImmutableDefault.schema().dumps(d_int) == '{"x": 0}'
        d_bool = DataClassBoolImmutableDefault()
        assert d_bool.x is False

# Path: tests/entities.py
# A = TypeVar('A')
# class DataClassWithDecimal(DataClassJsonMixin):
# class DataClassWithNewType(DataClassJsonMixin):
# class DataClassWithNestedNewType(DataClassJsonMixin):
# class DataClassWithList(DataClassJsonMixin):
# class DataClassWithListDefaultFactory(DataClassJsonMixin):
# class DataClassWithListStr(DataClassJsonMixin):
# class DataClassWithDict(DataClassJsonMixin):
# class DataClassWithDictInt(DataClassJsonMixin):
# class DataClassWithDictDefaultFactory(DataClassJsonMixin):
# class DataClassWithSet(DataClassJsonMixin):
# class DataClassWithTuple(DataClassJsonMixin):
# class DataClassWithFrozenSet(DataClassJsonMixin):
# class DataClassWithDeque(DataClassJsonMixin):
# class DataClassWithOptional(DataClassJsonMixin):
# class DataClassWithOptionalStr(DataClassJsonMixin):
# class DataClassWithOptionalNested(DataClassJsonMixin):
# class DataClassWithUnionIntNone(DataClassJsonMixin):
# class DataClassWithDataClass(DataClassJsonMixin):
# class DataClassX(DataClassJsonMixin):
# class DataClassXs(DataClassJsonMixin):
# class DataClassIntImmutableDefault(DataClassJsonMixin):
# class DataClassBoolImmutableDefault(DataClassJsonMixin):
# class DataClassMutableDefaultList(DataClassJsonMixin):
# class DataClassMutableDefaultDict(DataClassJsonMixin):
# class MyCollection(Collection[A]):
# class DataClassWithMyCollection(DataClassJsonMixin):
# class DataClassJsonDecorator:
# class DataClassWithConfigManual:
# class DataClassWithConfigHelper:
# class DataClassWithConfigDecorator:
# class DataClassWithUuid:
# class DataClassDefaultListStr:
# class DataClassChild:
# class DataClassDefaultOptionalList:
# class DataClassList:
# class DataClassOptional:
# class DataClassWithOptionalDatetime:
# class DataClassWithOptionalDecimal:
# class DataClassWithOptionalUuid:
# class DataClassWithNestedAny:
# class DataClassWithNestedOptionalAny:
# class DataClassWithNestedOptional:
# class DataClassWithNestedDictWithTupleKeys:
#     def __init__(self, xs: Collection[A]) -> None:
#     def __contains__(self, item):
#     def __iter__(self):
#     def __len__(self):
#     def __eq__(self, other):


# Path: tests/test_api.py
import sys
import pytest
from datetime import datetime, timezone
from decimal import Decimal
from uuid import UUID
from tests.entities import (DataClassBoolImmutableDefault,
                            DataClassIntImmutableDefault,
                            DataClassJsonDecorator,
                            DataClassWithConfigDecorator,
                            DataClassWithConfigHelper,
                            DataClassWithConfigManual, DataClassWithDataClass,
                            DataClassWithDecimal, DataClassWithList,
                            DataClassWithNestedNewType, DataClassWithNewType,
                            DataClassWithOptional,
                            DataClassWithOptionalDatetime,
                            DataClassWithOptionalDecimal,
                            DataClassWithOptionalNested,
                            DataClassWithOptionalUuid, DataClassWithUuid, UUIDWrapper,
                            UUIDWrapperWrapper)

        assert dumped == json_s

    def test_loads_many(self):
        json_s = '[{"xs": [1]}]'
        assert (DataClassWithList.schema().loads(json_s, many=True)
                == [DataClassWithList([1])])

    def test_loads_many_nested(self):
        json_s = '[{"dc_with_list": {"xs": [1]}}]'
        assert (DataClassWithDataClass.schema().loads(json_s, many=True)
                == [DataClassWithDataClass(DataClassWithList([1]))])

    def test_loads_default(self):
        assert (DataClassIntImmutableDefault.schema().loads('{}')
                == DataClassIntImmutableDefault())
        assert (DataClassBoolImmutableDefault.schema().loads('{}')
                == DataClassBoolImmutableDefault())

    def test_loads_default_many(self):
        assert (DataClassIntImmutableDefault.schema().loads('[{}]', many=True)
                == [DataClassIntImmutableDefault()])
        assert (DataClassBoolImmutableDefault.schema().loads('[{}]', many=True)
                == [DataClassBoolImmutableDefault()])

    def test_dumps_default(self):
        d_int = DataClassIntImmutableDefault()
        assert d_int.x == 0
        assert DataClassIntImmutableDefault.schema().dumps(d_int) == '{"x": 0}'
        d_bool = DataClassBoolImmutableDefault()
        assert d_bool.x is False

        assert DataClassBoolImmutableDefault.schema().dumps(