File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import os
22
3- from infuse_iot .tdf import TDF
3+ from infuse_iot .tdf import TDF , unknown_tdf_factory
44
55# assert "TOXTEMPDIR" in os.environ, "you must run these tests using tox"
66
@@ -61,3 +61,20 @@ def test_buffers():
6161 assert isinstance (tdf , TDF .Reading )
6262 total_tdfs += 1
6363 assert total_tdfs > 0
64+
65+
66+ def test_unknown_tdf ():
67+ for i in range (1 , 10 ):
68+ unknown_id = 400 + i
69+ unknown_len = 5 + i
70+ unknown_class = unknown_tdf_factory (unknown_id , unknown_len )
71+
72+ assert hasattr (unknown_class , "ID" )
73+ assert hasattr (unknown_class , "NAME" )
74+ assert hasattr (unknown_class , "data" )
75+
76+ unknown_inst = unknown_class .from_buffer_copy (unknown_len * b"\x00 " )
77+
78+ assert unknown_id == unknown_inst .ID
79+ assert str (unknown_id ) == unknown_inst .NAME
80+ assert unknown_len == len (unknown_inst .data )
You can’t perform that action at this time.
0 commit comments