File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed
Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -701,6 +701,7 @@ def _table(
701701 int (max_length ),
702702 fields_dict ,
703703 row_words ,
704+ has_mode = version >= (4 , 0 ),
704705 )
705706
706707 return field_name , field_info
Original file line number Diff line number Diff line change @@ -148,11 +148,16 @@ class TableFieldDetails:
148148
149149@dataclass
150150class TableFieldInfo (FieldInfo ):
151- """Extended `FieldInfo` for fields with type "table"""
151+ """Extended `FieldInfo` for fields with type "table"
152+
153+ Attribute "has_mode" is set to True when created from `GetFieldInfo`
154+ with API version >= (4, 0)
155+ """
152156
153157 max_length : int
154158 fields : dict [str , TableFieldDetails ]
155159 row_words : int
160+ has_mode : bool = False
156161
157162
158163@dataclass
Original file line number Diff line number Diff line change @@ -993,9 +993,18 @@ def test_get_fields_parameterized_type(
993993 ]
994994
995995
996- def test_get_fields_type_table ():
996+ @pytest .mark .parametrize (
997+ "api_version,expected_has_mode" ,
998+ [
999+ ((3 , 9 ), False ),
1000+ ((4 , 0 ), True ),
1001+ ((4 , 1 ), True ),
1002+ ],
1003+ )
1004+ def test_get_fields_type_table (api_version , expected_has_mode ):
9971005 """Test for table field type, including descriptions and retrieving enum labels"""
9981006 conn = ControlConnection ()
1007+ conn .set_api (api_version )
9991008 cmd = GetFieldInfo ("SEQ" )
10001009 assert conn .send (cmd ) == b"SEQ.*?\n "
10011010
@@ -1062,6 +1071,7 @@ def test_get_fields_type_table():
10621071 labels = None ,
10631072 ),
10641073 },
1074+ has_mode = expected_has_mode ,
10651075 )
10661076 },
10671077 )
You can’t perform that action at this time.
0 commit comments