@@ -352,6 +352,44 @@ async def test_get_device_info():
352
352
date_code = (date (2022 , 1 , 1 ), 'a0000042' ))
353
353
354
354
355
+ @pytest .mark .asyncio
356
+ async def test_get_device_info_date_code_filler ():
357
+ """
358
+ Verify behavior of the ``get_device_info`` command with a filler value for
359
+ date_code.
360
+ """
361
+ responses = {
362
+ b'<Command><Name>get_device_info</Name></Command>' :
363
+ b'<DeviceInfo>'
364
+ b' <DeviceMacId>0x0123456789ABCDEF</DeviceMacId>'
365
+ b' <InstallCode>0xABCDEF0123456789</InstallCode>'
366
+ b' <LinkKey>0xABCDEF0123456789ABCDEF0123456789</LinkKey>'
367
+ b' <FWVersion>1.21g</FWVersion>'
368
+ b' <HWVersion>5.55 rev 2</HWVersion>'
369
+ b' <ImageType>Mocked</ImageType>'
370
+ b' <Manufacturer>aioraven</Manufacturer>'
371
+ b' <ModelId>Python</ModelId>'
372
+ b' <DateCode>\xff \xff \xff \xff \xff \xff \xff \xff '
373
+ b'\xff \xff \xff \xff \xff \xff \xff \xff </DateCode>'
374
+ b'</DeviceInfo>' ,
375
+ }
376
+
377
+ async with mock_device (responses ) as (host , port ):
378
+ async with RAVEnNetworkDevice (host , port ) as dut :
379
+ actual = await dut .get_device_info ()
380
+
381
+ assert actual == DeviceInfo (
382
+ device_mac_id = bytes .fromhex ('0123456789ABCDEF' ),
383
+ install_code = bytes .fromhex ('ABCDEF0123456789' ),
384
+ link_key = bytes .fromhex ('ABCDEF0123456789ABCDEF0123456789' ),
385
+ fw_version = '1.21g' ,
386
+ hw_version = '5.55 rev 2' ,
387
+ image_type = 'Mocked' ,
388
+ manufacturer = 'aioraven' ,
389
+ model_id = 'Python' ,
390
+ date_code = None )
391
+
392
+
355
393
@pytest .mark .asyncio
356
394
async def test_get_instantaneous_demand ():
357
395
"""Verify behavior of the ``get_instantaneous_demand`` command."""
0 commit comments