from datetime import timedelta

from data_gateway_sdk.protocols.smpm.smpm_ul_device_energy_16b_tariff_generated import \
    SmpmUlDeviceEnergy16BTariffGeneratedData
from data_gateway_sdk.utils.buf_ref import BufRef


def test_smpm_ul_device_energy_16b_tariff_generated() -> None:
    case_serialized = bytes.fromhex("c10250320f1e60873948490500000000")
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=0.0), valid=False, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=123123, slot_1=4312123, slot_2=5413, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=0.0), valid=False, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=123123, slot_1=4312123, slot_2=5413, slot_3=0))  # noqa: E501
    case_serialized = bytes.fromhex("c1025802000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=0.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=0.0), energy_is_reactive=False, slot_0=0, slot_1=0, slot_2=0, slot_3=0, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
    case_serialized = bytes.fromhex("c1025802000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=0.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=0.0), energy_is_reactive=False, slot_0=0, slot_1=0, slot_2=0, slot_3=67108864, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
    case_serialized = bytes.fromhex("c1025802000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=0.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=0.0), energy_is_reactive=False, slot_0=0, slot_1=0, slot_2=67108864, slot_3=0, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
    case_serialized = bytes.fromhex("c1025802000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=0.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=0.0), energy_is_reactive=False, slot_0=0, slot_1=0, slot_2=67108864, slot_3=67108864, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
    case_serialized = bytes.fromhex("c1025802000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=0.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=0.0), energy_is_reactive=False, slot_0=0, slot_1=67108864, slot_2=0, slot_3=0, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
    case_serialized = bytes.fromhex("c1025802000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=0.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=0.0), energy_is_reactive=False, slot_0=0, slot_1=67108864, slot_2=0, slot_3=67108864, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
    case_serialized = bytes.fromhex("c1025802000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=0.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=0.0), energy_is_reactive=False, slot_0=0, slot_1=67108864, slot_2=67108864, slot_3=0, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
    case_serialized = bytes.fromhex("c1025802000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=0.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=0.0), energy_is_reactive=False, slot_0=0, slot_1=67108864, slot_2=67108864, slot_3=67108864, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
    case_serialized = bytes.fromhex("c1025802000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=0.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=0.0), energy_is_reactive=False, slot_0=67108864, slot_1=0, slot_2=0, slot_3=0, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
    case_serialized = bytes.fromhex("c1025802000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=0.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=0.0), energy_is_reactive=False, slot_0=67108864, slot_1=0, slot_2=0, slot_3=67108864, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
    case_serialized = bytes.fromhex("c1025802000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=0.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=0.0), energy_is_reactive=False, slot_0=67108864, slot_1=0, slot_2=67108864, slot_3=0, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
    case_serialized = bytes.fromhex("c1025802000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=0.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=0.0), energy_is_reactive=False, slot_0=67108864, slot_1=0, slot_2=67108864, slot_3=67108864, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
    case_serialized = bytes.fromhex("c1025802000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=0.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=0.0), energy_is_reactive=False, slot_0=67108864, slot_1=67108864, slot_2=0, slot_3=0, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
    case_serialized = bytes.fromhex("c1025802000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=0.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=0.0), energy_is_reactive=False, slot_0=67108864, slot_1=67108864, slot_2=0, slot_3=67108864, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
    case_serialized = bytes.fromhex("c1025802000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=0.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=0.0), energy_is_reactive=False, slot_0=67108864, slot_1=67108864, slot_2=67108864, slot_3=0, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
    case_serialized = bytes.fromhex("c1025802000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=0.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=0.0), energy_is_reactive=False, slot_0=67108864, slot_1=67108864, slot_2=67108864, slot_3=67108864, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
    case_serialized = bytes.fromhex("c1f25f02000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=10972800.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=10972800.0), energy_is_reactive=False, slot_0=0, slot_1=0, slot_2=0, slot_3=0, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
    case_serialized = bytes.fromhex("c1f25f02000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=10972800.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=10972800.0), energy_is_reactive=False, slot_0=0, slot_1=0, slot_2=0, slot_3=67108864, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
    case_serialized = bytes.fromhex("c1f25f02000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=10972800.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=10972800.0), energy_is_reactive=False, slot_0=0, slot_1=0, slot_2=67108864, slot_3=0, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
    case_serialized = bytes.fromhex("c1f25f02000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=10972800.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=10972800.0), energy_is_reactive=False, slot_0=0, slot_1=0, slot_2=67108864, slot_3=67108864, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
    case_serialized = bytes.fromhex("c1f25f02000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=10972800.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=10972800.0), energy_is_reactive=False, slot_0=0, slot_1=67108864, slot_2=0, slot_3=0, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
    case_serialized = bytes.fromhex("c1f25f02000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=10972800.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=10972800.0), energy_is_reactive=False, slot_0=0, slot_1=67108864, slot_2=0, slot_3=67108864, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
    case_serialized = bytes.fromhex("c1f25f02000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=10972800.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=10972800.0), energy_is_reactive=False, slot_0=0, slot_1=67108864, slot_2=67108864, slot_3=0, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
    case_serialized = bytes.fromhex("c1f25f02000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=10972800.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=10972800.0), energy_is_reactive=False, slot_0=0, slot_1=67108864, slot_2=67108864, slot_3=67108864, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
    case_serialized = bytes.fromhex("c1f25f02000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=10972800.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=10972800.0), energy_is_reactive=False, slot_0=67108864, slot_1=0, slot_2=0, slot_3=0, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
    case_serialized = bytes.fromhex("c1f25f02000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=10972800.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=10972800.0), energy_is_reactive=False, slot_0=67108864, slot_1=0, slot_2=0, slot_3=67108864, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
    case_serialized = bytes.fromhex("c1f25f02000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=10972800.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=10972800.0), energy_is_reactive=False, slot_0=67108864, slot_1=0, slot_2=67108864, slot_3=0, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
    case_serialized = bytes.fromhex("c1f25f02000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=10972800.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=10972800.0), energy_is_reactive=False, slot_0=67108864, slot_1=0, slot_2=67108864, slot_3=67108864, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
    case_serialized = bytes.fromhex("c1f25f02000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=10972800.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=10972800.0), energy_is_reactive=False, slot_0=67108864, slot_1=67108864, slot_2=0, slot_3=0, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
    case_serialized = bytes.fromhex("c1f25f02000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=10972800.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=10972800.0), energy_is_reactive=False, slot_0=67108864, slot_1=67108864, slot_2=0, slot_3=67108864, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
    case_serialized = bytes.fromhex("c1f25f02000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=10972800.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=10972800.0), energy_is_reactive=False, slot_0=67108864, slot_1=67108864, slot_2=67108864, slot_3=0, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
    case_serialized = bytes.fromhex("c1f25f02000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BTariffGeneratedData(energy_is_reactive=False, days_ago=timedelta(seconds=10972800.0), valid=True, tariff_mask=(True, False, True, False, False, True, False, False), slot_0=0, slot_1=0, slot_2=0, slot_3=0) == SmpmUlDeviceEnergy16BTariffGeneratedData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BTariffGeneratedData.serialize(SmpmUlDeviceEnergy16BTariffGeneratedData(days_ago=timedelta(seconds=10972800.0), energy_is_reactive=False, slot_0=67108864, slot_1=67108864, slot_2=67108864, slot_3=67108864, tariff_mask=(True, False, True, False, False, True, False, False), valid=True))  # noqa: E501
