@@ -64,7 +64,7 @@ class SimpleEnum(IntEnum):
64
64
READY = 1
65
65
RUNNING = 2
66
66
67
- class TestParamBase :
67
+ class ParamBase :
68
68
"""Base class for test parameter sets."""
69
69
# Values used in tests
70
70
DEFAULT_VAL = []
@@ -118,7 +118,7 @@ def _format_item(self, item) -> str:
118
118
119
119
# --- Parameter Sets for Different List Item Types ---
120
120
121
- class StrParams (TestParamBase ):
121
+ class StrParams (ParamBase ):
122
122
"""Parameters for ListOption[str]."""
123
123
DEFAULT_VAL = ["DEFAULT_value" ]
124
124
PRESENT_VAL = ["present_value_1" , "present_value_2" ]
@@ -148,7 +148,7 @@ class StrParams(TestParamBase):
148
148
option_name =
149
149
"""
150
150
151
- class IntParams (TestParamBase ):
151
+ class IntParams (ParamBase ):
152
152
"""Parameters for ListOption[int]."""
153
153
DEFAULT_VAL = [0 ]
154
154
PRESENT_VAL = [10 , 20 ]
@@ -177,7 +177,7 @@ class IntParams(TestParamBase):
177
177
option_name =
178
178
"""
179
179
180
- class FloatParams (TestParamBase ):
180
+ class FloatParams (ParamBase ):
181
181
"""Parameters for ListOption[float]."""
182
182
DEFAULT_VAL = [0.0 ]
183
183
PRESENT_VAL = [10.1 , 20.2 ]
@@ -206,7 +206,7 @@ class FloatParams(TestParamBase):
206
206
option_name =
207
207
"""
208
208
209
- class DecimalParams (TestParamBase ):
209
+ class DecimalParams (ParamBase ):
210
210
"""Parameters for ListOption[Decimal]."""
211
211
DEFAULT_VAL = [Decimal ("0.0" )]
212
212
PRESENT_VAL = [Decimal ("10.1" ), Decimal ("20.2" )]
@@ -235,7 +235,7 @@ class DecimalParams(TestParamBase):
235
235
option_name =
236
236
"""
237
237
238
- class BoolParams (TestParamBase ):
238
+ class BoolParams (ParamBase ):
239
239
"""Parameters for ListOption[bool]."""
240
240
DEFAULT_VAL = [False ] # From "0"
241
241
PRESENT_VAL = [True , False ]
@@ -264,7 +264,7 @@ class BoolParams(TestParamBase):
264
264
option_name =
265
265
"""
266
266
267
- class UUIDParams (TestParamBase ):
267
+ class UUIDParams (ParamBase ):
268
268
"""Parameters for ListOption[UUID]."""
269
269
DEFAULT_VAL = [UUID ("eeb7f94a-256d-11ea-ad1d-5404a6a1fd6e" )]
270
270
PRESENT_VAL = [UUID ("0a7fd53a-256e-11ea-ad1d-5404a6a1fd6e" ),
@@ -297,7 +297,7 @@ class UUIDParams(TestParamBase):
297
297
option_name =
298
298
"""
299
299
300
- class MIMEParams (TestParamBase ):
300
+ class MIMEParams (ParamBase ):
301
301
"""Parameters for ListOption[MIME]."""
302
302
DEFAULT_VAL = [MIME ("application/octet-stream" )]
303
303
PRESENT_VAL = [MIME ("text/plain;charset=utf-8" ), MIME ("text/csv" )]
@@ -328,7 +328,7 @@ class MIMEParams(TestParamBase):
328
328
option_name =
329
329
"""
330
330
331
- class ZMQAddressParams (TestParamBase ):
331
+ class ZMQAddressParams (ParamBase ):
332
332
"""Parameters for ListOption[ZMQAddress]."""
333
333
DEFAULT_VAL = [ZMQAddress ("tcp://127.0.0.1:*" )]
334
334
PRESENT_VAL = [ZMQAddress ("ipc://@my-address" ), ZMQAddress ("inproc://my-address" ), ZMQAddress ("tcp://127.0.0.1:9001" )]
@@ -357,7 +357,7 @@ class ZMQAddressParams(TestParamBase):
357
357
option_name =
358
358
"""
359
359
360
- class MultiTypeParams (TestParamBase ):
360
+ class MultiTypeParams (ParamBase ):
361
361
"""Parameters for ListOption with multiple item types."""
362
362
DEFAULT_VAL = ["DEFAULT_value" ] # From str:DEFAULT_value
363
363
PRESENT_VAL = [1 , 1.1 , Decimal ("1.01" ), True ,
@@ -413,7 +413,7 @@ class MultiTypeParams(TestParamBase):
413
413
MIMEParams , ZMQAddressParams , MultiTypeParams ]
414
414
415
415
@pytest .fixture (params = params )
416
- def test_params (base_conf : ConfigParser , request ) -> TestParamBase :
416
+ def test_params (base_conf : ConfigParser , request ) -> ParamBase :
417
417
"""Fixture providing parameterized test data for ListOption tests."""
418
418
param_class = request .param
419
419
data = param_class ()
@@ -425,7 +425,7 @@ def test_params(base_conf: ConfigParser, request) -> TestParamBase:
425
425
426
426
# --- Test Cases ---
427
427
428
- def test_simple (test_params : TestParamBase ):
428
+ def test_simple (test_params : ParamBase ):
429
429
"""Tests basic ListOption: init, load, value access, clear, default handling."""
430
430
opt = config .ListOption ("option_name" , test_params .ITEM_TYPE , "description" )
431
431
@@ -479,7 +479,7 @@ def test_simple(test_params: TestParamBase):
479
479
opt .value = [test_params .NEW_VAL [0 ], 123 ] # Assign int to str list
480
480
481
481
482
- def test_required (test_params : TestParamBase ):
482
+ def test_required (test_params : ParamBase ):
483
483
"""Tests ListOption with the 'required' flag."""
484
484
opt = config .ListOption ("option_name" , test_params .ITEM_TYPE , "description" , required = True )
485
485
@@ -511,7 +511,7 @@ def test_required(test_params: TestParamBase):
511
511
assert opt .value == test_params .NEW_VAL
512
512
opt .validate ()
513
513
514
- def test_bad_value (test_params : TestParamBase ):
514
+ def test_bad_value (test_params : ParamBase ):
515
515
"""Tests loading invalid list string values."""
516
516
opt = config .ListOption ("option_name" , test_params .ITEM_TYPE , "description" )
517
517
@@ -552,7 +552,7 @@ def test_bad_value(test_params: TestParamBase):
552
552
assert excinfo .value .args == test_params .BAD_MSG
553
553
554
554
555
- def test_default (test_params : TestParamBase ):
555
+ def test_default (test_params : ParamBase ):
556
556
"""Tests ListOption with a defined default list value."""
557
557
opt = config .ListOption ("option_name" , test_params .ITEM_TYPE , "description" ,
558
558
default = test_params .DEFAULT_OPT_VAL )
@@ -591,7 +591,7 @@ def test_default(test_params: TestParamBase):
591
591
opt .value .append (test_params .DEFAULT_VAL [0 ]) # Modify the current value list
592
592
assert opt .default == test_params .DEFAULT_OPT_VAL # Original default should be unchanged
593
593
594
- def test_proto (test_params : TestParamBase , proto : ConfigProto ):
594
+ def test_proto (test_params : ParamBase , proto : ConfigProto ):
595
595
"""Tests serialization to and deserialization from Protobuf messages."""
596
596
opt = config .ListOption ("option_name" , test_params .ITEM_TYPE , "description" ,
597
597
default = test_params .DEFAULT_OPT_VAL )
@@ -650,7 +650,7 @@ def test_proto(test_params: TestParamBase, proto: ConfigProto):
650
650
assert excinfo .value .args == test_params .BAD_MSG
651
651
652
652
653
- def test_get_config (test_params : TestParamBase ):
653
+ def test_get_config (test_params : ParamBase ):
654
654
"""Tests the get_config method for generating config file string representation."""
655
655
opt = config .ListOption ("option_name" , test_params .ITEM_TYPE , "description" ,
656
656
default = test_params .DEFAULT_OPT_VAL )
@@ -694,7 +694,7 @@ def test_get_config(test_params: TestParamBase):
694
694
opt .set_value (None )
695
695
assert opt .get_config (plain = True ) == "option_name = <UNDEFINED>\n "
696
696
697
- def test_separator_override (test_params : TestParamBase ):
697
+ def test_separator_override (test_params : ParamBase ):
698
698
"""Tests ListOption with an explicit separator."""
699
699
# Use semicolon as separator
700
700
opt = config .ListOption ("option_name" , test_params .ITEM_TYPE , "description" ,
0 commit comments