from data_gateway_sdk.protocols.smpm.smpm_dl_device_energy_16b_set_regular_data_sending import SmpmDlDeviceEnergy16BSetRegularDataSendingData, \
    SmpmDlDeviceEnergy16bSetRegularDataSendingDataRequestId, SpecUpLinkModelingPacketIdU8Action
from data_gateway_sdk.utils.buf_ref import BufRef


def test_smpm_dl_device_energy_16b_set_regular_data_sending() -> None:
    case_serialized = bytes.fromhex("96d909f8000000000000000000000000")
    assert SmpmDlDeviceEnergy16BSetRegularDataSendingData(pack_id=SmpmDlDeviceEnergy16bSetRegularDataSendingDataRequestId.UL_DATA_16B__ENERGY, action=SpecUpLinkModelingPacketIdU8Action.REPLACE, period_ago=31, week_mask=(False, False, False, False, False, False, False), days_mask=(False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False), hour_mask=(False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False)) == SmpmDlDeviceEnergy16BSetRegularDataSendingData.parse(BufRef(case_serialized))  # noqa: E501
    case_serialized = bytes.fromhex("96d90906000000000000000000000000")  # overflow
    assert SmpmDlDeviceEnergy16BSetRegularDataSendingData(pack_id=SmpmDlDeviceEnergy16bSetRegularDataSendingDataRequestId.UL_DATA_16B__ENERGY, action=SpecUpLinkModelingPacketIdU8Action.REPLACE_DAY, period_ago=0, week_mask=(False, False, False, False, False, False, False), days_mask=(False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False), hour_mask=(False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False)) == SmpmDlDeviceEnergy16BSetRegularDataSendingData.parse(BufRef(case_serialized))  # noqa: E501
    case_serialized = bytes.fromhex("96d909fe010000000000000000000000")  # overflow
    assert SmpmDlDeviceEnergy16BSetRegularDataSendingData(pack_id=SmpmDlDeviceEnergy16bSetRegularDataSendingDataRequestId.UL_DATA_16B__ENERGY, action=SpecUpLinkModelingPacketIdU8Action.REPLACE_DAY, period_ago=63, week_mask=(False, False, False, False, False, False, False), days_mask=(False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False), hour_mask=(False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False)) == SmpmDlDeviceEnergy16BSetRegularDataSendingData.parse(BufRef(case_serialized))  # noqa: E501
