Exemplo n.º 1
0
 def test_C_TA_VM_2(self):
     c = app_asdu.C_TA_VM_2(datetime.datetime(2018, 7, 1, 1),
                            datetime.datetime(2018, 8, 1, 0))
     self.assertEqual(
         c.to_bytes(),
         bytearray(bytearray.fromhex("00 01 e1 07 12 00 00 61 08 12")))
     self.assertEqual(c.length, 19)
Exemplo n.º 2
0
 def test_C_TA_VM_2_from_hex(self):
     c = app_asdu.C_TA_VM_2()
     c.from_hex(bytearray.fromhex("00 01 e1 07 12 00 00 61 08 12"), 1)
     self.assertEqual(c.start_date.datetime,
                      localize(datetime.datetime(2018, 7, 1, 1)))
     self.assertEqual(c.end_date.datetime,
                      localize(datetime.datetime(2018, 8, 1, 0)))