@@ -0,0 +1,886 @@
+import os%0Aimport sys%0Aimport json%0A%0AmyPath = os.path.dirname(os.path.abspath(__file__))%0Asys.path.insert(0, myPath + '/../')%0A%0Aimport unittest%0Aimport meterbus%0Afrom meterbus.exceptions import *%0A%0A%0Aclass TestSequenceFunctions(unittest.TestCase):%0A    def setUp(self):%0A        self.frame = %22%5Cx68%5Cx03%5Cx03%5Cx68%5Cx08%5Cx0b%5CxFF%5Cx16%22%0A%0A    def test_json(self):%0A        hdr = meterbus.TelegramHeader()%0A        hdr.load(self.frame)%0A        jd = json.loads(hdr.to_JSON())%0A%0A        with self.subTest():%0A            self.assertEqual(jd%5B'start'%5D, %220x68%22)%0A        with self.subTest():%0A            self.assertEqual(jd%5B'stop'%5D, %220x16%22)%0A        with self.subTest():%0A            self.assertEqual(jd%5B'length'%5D, %220x3%22)%0A        with self.subTest():%0A            self.assertEqual(jd%5B'a'%5D, %220xb%22)%0A        with self.subTest():%0A            self.assertEqual(jd%5B'crc'%5D, %220xff%22)%0A%0Aif __name__ == '__main__':%0A    unittest.main()%0A

Test telegram header JSON