fix messgae unit tests
This commit is contained in:
@@ -318,6 +318,8 @@ class Message(metaclass=IterRegistry):
|
|||||||
self.header_len)
|
self.header_len)
|
||||||
logger.debug(f'tsun-time: {result[0]:08x}'
|
logger.debug(f'tsun-time: {result[0]:08x}'
|
||||||
f' proxy-time: {ts:08x}')
|
f' proxy-time: {ts:08x}')
|
||||||
|
elif not self.ctrl.is_ind():
|
||||||
|
self.inc_counter('Unknown_Ctrl')
|
||||||
else:
|
else:
|
||||||
if self.ctrl.is_ind():
|
if self.ctrl.is_ind():
|
||||||
ts = self.__timestamp()
|
ts = self.__timestamp()
|
||||||
|
|||||||
@@ -342,8 +342,8 @@ def test_msg_get_time(ConfigTsunInv1, MsgGetTime):
|
|||||||
assert m.db.stat['proxy']['Unknown_Ctrl'] == 0
|
assert m.db.stat['proxy']['Unknown_Ctrl'] == 0
|
||||||
m.close()
|
m.close()
|
||||||
|
|
||||||
def test_msg_time_resp(ConfigTsunInv1, MsgTimeResp):
|
def test_msg_time_resp(ConfigNoTsunInv1, MsgTimeResp):
|
||||||
ConfigTsunInv1
|
ConfigNoTsunInv1
|
||||||
m = MemoryStream(MsgTimeResp, (0,), False)
|
m = MemoryStream(MsgTimeResp, (0,), False)
|
||||||
m.db.stat['proxy']['Unknown_Ctrl'] = 0
|
m.db.stat['proxy']['Unknown_Ctrl'] = 0
|
||||||
m.read() # read complete msg, and dispatch msg
|
m.read() # read complete msg, and dispatch msg
|
||||||
|
|||||||
Reference in New Issue
Block a user