fix messgae unit tests

This commit is contained in:
Stefan Allius
2023-11-13 00:01:26 +01:00
parent 4b7431ede9
commit a47ebb1511
2 changed files with 4 additions and 2 deletions

View File

@@ -318,6 +318,8 @@ class Message(metaclass=IterRegistry):
self.header_len)
logger.debug(f'tsun-time: {result[0]:08x}'
f' proxy-time: {ts:08x}')
elif not self.ctrl.is_ind():
self.inc_counter('Unknown_Ctrl')
else:
if self.ctrl.is_ind():
ts = self.__timestamp()

View File

@@ -342,8 +342,8 @@ def test_msg_get_time(ConfigTsunInv1, MsgGetTime):
assert m.db.stat['proxy']['Unknown_Ctrl'] == 0
m.close()
def test_msg_time_resp(ConfigTsunInv1, MsgTimeResp):
ConfigTsunInv1
def test_msg_time_resp(ConfigNoTsunInv1, MsgTimeResp):
ConfigNoTsunInv1
m = MemoryStream(MsgTimeResp, (0,), False)
m.db.stat['proxy']['Unknown_Ctrl'] = 0
m.read() # read complete msg, and dispatch msg