# Path: tests/base.py
# ALL_FIELDS = [
#     fields.String,
#     fields.Integer,
#     fields.Boolean,
#     fields.Float,
#     fields.Number,
#     fields.DateTime,
#     fields.Time,
#     fields.Date,
#     fields.TimeDelta,
#     fields.Dict,
#     fields.Url,
#     fields.Email,
#     fields.UUID,
#     fields.Decimal,
#     fields.IP,
#     fields.IPv4,
#     fields.IPv6,
#     fields.IPInterface,
#     fields.IPv4Interface,
#     fields.IPv6Interface,
# ]
#     SPECIES = "Homo sapiens"
# def assert_date_equal(d1, d2):
# def assert_time_equal(t1, t2):
#     def __init__(
#         self,
#         name,
#         age=0,
#         id_=None,
#         homepage=None,
#         email=None,
#         registered=True,
#         time_registered=None,
#         birthdate=None,
#         birthtime=None,
#         balance=100,
#         sex="male",
#         employer=None,
#         various_data=None,
#     ):
#     def since_created(self):
#     def __repr__(self):
#     def __init__(self, title, user, collaborators=None, categories=None, id_=None):
#     def __contains__(self, item):
#     def __init__(self, foo):
#     def __eq__(self, other):
#     def __str__(self):
#     def _serialize(self, value, attr, obj):
# def get_lowername(obj):
#     def get_is_old(self, obj):
#     def make_user(self, data, **kwargs):
#     def get_is_old(self, obj):
#     def dumps(val):
#     def loads(val):
# class User:
# class Blog:
# class DummyModel:
# class Uppercased(fields.Field):
# class UserSchema(Schema):
#     class Meta:
# class UserMetaSchema(Schema):
#     class Meta:
# class UserExcludeSchema(UserSchema):
#     class Meta:
# class UserAdditionalSchema(Schema):
#     class Meta:
# class UserIntSchema(UserSchema):
# class UserFloatStringSchema(UserSchema):
# class ExtendedUserSchema(UserSchema):
# class UserRelativeUrlSchema(UserSchema):
# class BlogSchema(Schema):
# class BlogUserMetaSchema(Schema):
# class BlogSchemaMeta(Schema):
#     class Meta:
# class BlogOnlySchema(Schema):
# class BlogSchemaExclude(BlogSchema):
# class BlogSchemaOnlyExclude(BlogSchema):
# class mockjson:  # noqa


import datetime as dt
import pytest
from collections import namedtuple
from functools import partial
from copy import copy, deepcopy
from marshmallow import utils, fields, Schema
from tests.base import central, assert_time_equal, assert_date_equal


class PointClass:
    def __init__(self, x, y):
        self.x = x
        self.y = y


class PointDict(dict):
    def __init__(self, x, y):
        super().__init__({"x": x})
        self.y = y


@pytest.mark.parametrize(
    "obj", [PointNT(24, 42), PointClass(24, 42), PointDict(24, 42), {"x": 24, "y": 42}]
)
def test_get_value_from_object(obj):
    assert utils.get_value(obj, "x") == 24
    assert utils.get_value(obj, "y") == 42


def test_get_value_from_namedtuple_with_default():
    p = PointNT(x=42, y=None)
    # Default is only returned if key is not found
    assert utils.get_value(p, "z", default=123) == 123
    # since 'y' is an attribute, None is returned instead of the default
    assert utils.get_value(p, "y", default=123) is None



# Path: tests/base.py
# ALL_FIELDS = [
#     fields.String,
#     fields.Integer,
#     fields.Boolean,
#     fields.Float,
#     fields.Number,
#     fields.DateTime,
#     fields.Time,
#     fields.Date,
#     fields.TimeDelta,
#     fields.Dict,
#     fields.Url,
#     fields.Email,
#     fields.UUID,
#     fields.Decimal,
#     fields.IP,
#     fields.IPv4,
#     fields.IPv6,
#     fields.IPInterface,
#     fields.IPv4Interface,
#     fields.IPv6Interface,
# ]
#     SPECIES = "Homo sapiens"
# def assert_date_equal(d1, d2):
# def assert_time_equal(t1, t2):
#     def __init__(
#         self,
#         name,
#         age=0,
#         id_=None,
#         homepage=None,
#         email=None,
#         registered=True,
#         time_registered=None,
#         birthdate=None,
#         birthtime=None,
#         balance=100,
#         sex="male",
#         employer=None,
#         various_data=None,
#     ):
#     def since_created(self):
#     def __repr__(self):
#     def __init__(self, title, user, collaborators=None, categories=None, id_=None):
#     def __contains__(self, item):
#     def __init__(self, foo):
#     def __eq__(self, other):
#     def __str__(self):
#     def _serialize(self, value, attr, obj):
# def get_lowername(obj):
#     def get_is_old(self, obj):
#     def make_user(self, data, **kwargs):
#     def get_is_old(self, obj):
#     def dumps(val):
#     def loads(val):
# class User:
# class Blog:
# class DummyModel:
# class Uppercased(fields.Field):
# class UserSchema(Schema):
#     class Meta:
# class UserMetaSchema(Schema):
#     class Meta:
# class UserExcludeSchema(UserSchema):
#     class Meta:
# class UserAdditionalSchema(Schema):
#     class Meta:
# class UserIntSchema(UserSchema):
# class UserFloatStringSchema(UserSchema):
# class ExtendedUserSchema(UserSchema):
# class UserRelativeUrlSchema(UserSchema):
# class BlogSchema(Schema):
# class BlogUserMetaSchema(Schema):
# class BlogSchemaMeta(Schema):
#     class Meta:
# class BlogOnlySchema(Schema):
# class BlogSchemaExclude(BlogSchema):
# class BlogSchemaOnlyExclude(BlogSchema):
# class mockjson:  # noqa


# Path: tests/test_utils.py
import datetime as dt
import pytest
from collections import namedtuple
from functools import partial
from copy import copy, deepcopy
from marshmallow import utils, fields, Schema
from tests.base import central, assert_time_equal, assert_date_equal



class PointClass:
    def __init__(self, x, y):
        self.x = x
        self.y = y


class PointDict(dict):
    def __init__(self, x, y):
        super().__init__({"x": x})
        self.y = y


@pytest.mark.parametrize(
    "obj", [PointNT(24, 42), PointClass(24, 42), PointDict(24, 42), {"x": 24, "y": 42}]
)
def test_get_value_from_object(obj):
    assert utils.get_value(obj, "x") == 24
    assert utils.get_value(obj, "y") == 42


def test_get_value_from_namedtuple_with_default():
    p = PointNT(x=42, y=None)
    # Default is only returned if key is not found
    assert utils.get_value(p, "z", default=123) == 123
    # since 'y' is an attribute, None is returned instead of the default
    assert utils.get_value(p, "y", default=123) is None



class Triangle: