@@ -49,7 +49,7 @@ def test_toggles_rule_does_not_match(mocker, config):
49
49
mocked_app_config_schema = {
50
50
"features" : {
51
51
"my_feature" : {
52
- "feature_default_value " : expected_value ,
52
+ "default " : expected_value ,
53
53
"rules" : [
54
54
{
55
55
"rule_name" : "tenant id equals 345345435" ,
@@ -76,7 +76,7 @@ def test_toggles_rule_does_not_match(mocker, config):
76
76
# you get the default value of False that was sent to the evaluate API
77
77
def test_toggles_no_conditions_feature_does_not_exist (mocker , config ):
78
78
expected_value = False
79
- mocked_app_config_schema = {"features" : {"my_fake_feature" : {"feature_default_value " : True }}}
79
+ mocked_app_config_schema = {"features" : {"my_fake_feature" : {"default " : True }}}
80
80
81
81
conf_store = init_configuration_store (mocker , mocked_app_config_schema , config )
82
82
toggle = conf_store .evaluate (name = "my_feature" , context = {}, default = expected_value )
@@ -87,7 +87,7 @@ def test_toggles_no_conditions_feature_does_not_exist(mocker, config):
87
87
# default value is False but the feature has a True default_value.
88
88
def test_toggles_no_rules (mocker , config ):
89
89
expected_value = True
90
- mocked_app_config_schema = {"features" : {"my_feature" : {"feature_default_value " : expected_value }}}
90
+ mocked_app_config_schema = {"features" : {"my_feature" : {"default " : expected_value }}}
91
91
conf_store = init_configuration_store (mocker , mocked_app_config_schema , config )
92
92
toggle = conf_store .evaluate (name = "my_feature" , context = {"tenant_id" : "6" , "username" : "a" }, default = False )
93
93
assert toggle == expected_value
@@ -99,7 +99,7 @@ def test_toggles_conditions_no_match(mocker, config):
99
99
mocked_app_config_schema = {
100
100
"features" : {
101
101
"my_feature" : {
102
- "feature_default_value " : expected_value ,
102
+ "default " : expected_value ,
103
103
"rules" : [
104
104
{
105
105
"rule_name" : "tenant id equals 345345435" ,
@@ -129,7 +129,7 @@ def test_toggles_conditions_rule_match_equal_multiple_conditions(mocker, config)
129
129
mocked_app_config_schema = {
130
130
"features" : {
131
131
"my_feature" : {
132
- "feature_default_value " : True ,
132
+ "default " : True ,
133
133
"rules" : [
134
134
{
135
135
"rule_name" : "tenant id equals 6 and username is a" ,
@@ -171,7 +171,7 @@ def test_toggles_conditions_no_rule_match_equal_multiple_conditions(mocker, conf
171
171
mocked_app_config_schema = {
172
172
"features" : {
173
173
"my_feature" : {
174
- "feature_default_value " : expected_val ,
174
+ "default " : expected_val ,
175
175
"rules" : [
176
176
{
177
177
"rule_name" : "tenant id equals 645654 and username is a" , # rule will not match
@@ -207,7 +207,7 @@ def test_toggles_conditions_rule_match_multiple_actions_multiple_rules_multiple_
207
207
mocked_app_config_schema = {
208
208
"features" : {
209
209
"my_feature" : {
210
- "feature_default_value " : expected_value_third_check ,
210
+ "default " : expected_value_third_check ,
211
211
"rules" : [
212
212
{
213
213
"rule_name" : "tenant id equals 6 and username startswith a" ,
@@ -276,7 +276,7 @@ def test_toggles_match_rule_with_contains_action(mocker, config):
276
276
mocked_app_config_schema = {
277
277
"features" : {
278
278
"my_feature" : {
279
- "feature_default_value " : False ,
279
+ "default " : False ,
280
280
"rules" : [
281
281
{
282
282
"rule_name" : "tenant id is contained in [6, 2]" ,
@@ -303,7 +303,7 @@ def test_toggles_no_match_rule_with_contains_action(mocker, config):
303
303
mocked_app_config_schema = {
304
304
"features" : {
305
305
"my_feature" : {
306
- "feature_default_value " : expected_value ,
306
+ "default " : expected_value ,
307
307
"rules" : [
308
308
{
309
309
"rule_name" : "tenant id is contained in [8, 2]" ,
@@ -330,7 +330,7 @@ def test_multiple_features_enabled(mocker, config):
330
330
mocked_app_config_schema = {
331
331
"features" : {
332
332
"my_feature" : {
333
- "feature_default_value " : False ,
333
+ "default " : False ,
334
334
"rules" : [
335
335
{
336
336
"rule_name" : "tenant id is contained in [6, 2]" ,
@@ -346,10 +346,10 @@ def test_multiple_features_enabled(mocker, config):
346
346
],
347
347
},
348
348
"my_feature2" : {
349
- "feature_default_value " : True ,
349
+ "default " : True ,
350
350
},
351
351
"my_feature3" : {
352
- "feature_default_value " : False ,
352
+ "default " : False ,
353
353
},
354
354
},
355
355
}
@@ -363,7 +363,7 @@ def test_multiple_features_only_some_enabled(mocker, config):
363
363
mocked_app_config_schema = {
364
364
"features" : {
365
365
"my_feature" : { # rule will match here, feature is enabled due to rule match
366
- "feature_default_value " : False ,
366
+ "default " : False ,
367
367
"rules" : [
368
368
{
369
369
"rule_name" : "tenant id is contained in [6, 2]" ,
@@ -379,13 +379,13 @@ def test_multiple_features_only_some_enabled(mocker, config):
379
379
],
380
380
},
381
381
"my_feature2" : {
382
- "feature_default_value " : True ,
382
+ "default " : True ,
383
383
},
384
384
"my_feature3" : {
385
- "feature_default_value " : False ,
385
+ "default " : False ,
386
386
},
387
387
"my_feature4" : { # rule will not match here, feature is enabled by default
388
- "feature_default_value " : True ,
388
+ "default " : True ,
389
389
"rules" : [
390
390
{
391
391
"rule_name" : "tenant id equals 7" ,
0 commit comments