import unittest
class Test3762(unittest.TestCase):
def test_50F1DL(self):
# 测试50F1组包
pk = pkt_3762_5001dl().get_pkt_int_list(1)
result = os_utils.int_list_to_hexstr(pk)
expect = '68 0F 00 00 00 00 00 00 00 01 50 01 00 52 16'
self.assertEqual(result, expect)
def test_50F3DL(self):
# 测试50F3组包
pk = pkt_3762_5003dl().get_pkt_int_list(8)
result = os_utils.int_list_to_hexstr(pk)
expect = '68 0F 00 40 00 00 00 00 00 08 50 04 00 9C 16'
self.assertEqual(result, expect)
if __name__ == '__main__':
# 方式1、
unittest.main(verbosity=2) # 运行所有测试用例
# 方式2、
suite = unittest.TestLoader().loadTestsFromTestCase(Test3762) # 运行该类的所有测试用例
unittest.TextTestRunner(verbosity=2).run(suite)
# 方式3、
suite = unittest.TestSuite()
suite.addTest(Test3762('test_50F3DL')) # 运行指定测试用例 适合调试使用
unittest.TextTestRunner(verbosity=2).run(suite)