@@ -301,10 +301,47 @@ def test_validate_condition_missing_condition_value():
301
301
}
302
302
303
303
# WHEN calling validate_condition
304
- with pytest .raises (SchemaValidationError , match = "'value' key must not be empty " ):
304
+ with pytest .raises (SchemaValidationError , match = "'value' key must not be null " ):
305
305
ConditionsValidator .validate_condition_value (condition = condition , rule_name = "dummy" )
306
306
307
307
308
+ def test_validate_condition_none_condition_value ():
309
+ # GIVEN a configuration with a missing condition value
310
+ condition = {
311
+ "action" : RuleAction .EQUALS .value ,
312
+ "key" : "tenant_id" ,
313
+ "value" : None ,
314
+ }
315
+
316
+ # WHEN calling validate_condition
317
+ with pytest .raises (SchemaValidationError , match = "'value' key must not be null" ):
318
+ ConditionsValidator .validate_condition_value (condition = condition , rule_name = "dummy" )
319
+
320
+
321
+ def test_validate_condition_empty_condition_value ():
322
+ # GIVEN a configuration with a missing condition value
323
+ condition = {
324
+ "action" : RuleAction .EQUALS .value ,
325
+ "key" : "tenant_id" ,
326
+ "value" : "" ,
327
+ }
328
+
329
+ # WHEN calling validate_condition
330
+ ConditionsValidator .validate_condition_value (condition = condition , rule_name = "dummy" )
331
+
332
+
333
+ def test_validate_condition_valid_falsy_condition_value ():
334
+ # GIVEN a configuration with a missing condition value
335
+ condition = {
336
+ "action" : RuleAction .EQUALS .value ,
337
+ "key" : "tenant_id" ,
338
+ "value" : 0 ,
339
+ }
340
+
341
+ # WHEN calling validate_condition
342
+ ConditionsValidator .validate_condition_value (condition = condition , rule_name = "dummy" )
343
+
344
+
308
345
def test_validate_rule_invalid_rule_type ():
309
346
# GIVEN an invalid rule type of empty list
310
347
# WHEN calling validate_rule
0 commit comments