@@ -913,7 +913,7 @@ def test_init__with_v4_datafile(self):
913913 'test_feature_in_group' : entities .FeatureFlag ('91113' , 'test_feature_in_group' , ['32222' ], '' , {}, '19228' )
914914 }
915915
916- expected_rollout_id_map = {
916+ expected_layer_id_map = {
917917 '211111' : entities .Layer ('211111' , [{
918918 'key' : '211112' ,
919919 'status' : 'Running' ,
@@ -970,7 +970,7 @@ def test_init__with_v4_datafile(self):
970970 self .assertEqual (expected_variation_key_map , project_config .variation_key_map )
971971 self .assertEqual (expected_variation_id_map , project_config .variation_id_map )
972972 self .assertEqual (expected_feature_key_map , project_config .feature_key_map )
973- self .assertEqual (expected_rollout_id_map , project_config .rollout_id_map )
973+ self .assertEqual (expected_layer_id_map , project_config .layer_id_map )
974974 self .assertEqual (expected_variation_variable_usage_map , project_config .variation_variable_usage_map )
975975
976976 def test_get_version (self ):
@@ -1128,27 +1128,27 @@ def test_get_group__invalid_id(self):
11281128
11291129 def test_get_feature_from_key__valid_feature_key (self ):
11301130 """ Test that a valid feature is returned given a valid feature key. """
1131- opt_obj = optimizely .Optimizely (json .dumps (self .config_dict_with_features ))
1132- project_config = opt_obj .config
1131+ optimizely_instance = optimizely .Optimizely (json .dumps (self .config_dict_with_features ))
1132+ project_config = optimizely_instance .config
11331133
11341134 expected_feature = entities .FeatureFlag ('91112' , 'test_feature_in_rollout' , [], '211111' , {})
11351135 self .assertEqual (expected_feature , project_config .get_feature_from_key ('test_feature_in_rollout' ))
11361136
11371137 def test_get_feature_from_key__invalid_feature_key (self ):
11381138 """ Test that None is returned given an invalid feature key. """
11391139
1140- opt_obj = optimizely .Optimizely (json .dumps (self .config_dict_with_features ))
1141- project_config = opt_obj .config
1140+ optimizely_instance = optimizely .Optimizely (json .dumps (self .config_dict_with_features ))
1141+ project_config = optimizely_instance .config
11421142
11431143 self .assertIsNone (project_config .get_feature_from_key ('invalid_feature_key' ))
11441144
1145- def test_get_rollout_from_id__valid_rollout_id (self ):
1146- """ Test that a valid rollout is returned """
1145+ def test_get_layer_from_id__valid_layer_id (self ):
1146+ """ Test that a valid layer is returned """
11471147
1148- opt_obj = optimizely .Optimizely (json .dumps (self .config_dict_with_features ))
1149- project_config = opt_obj .config
1148+ optimizely_instance = optimizely .Optimizely (json .dumps (self .config_dict_with_features ))
1149+ project_config = optimizely_instance .config
11501150
1151- expected_rollout = entities .Layer ('211111' , [{
1151+ expected_layer = entities .Layer ('211111' , [{
11521152 'id' : '211127' ,
11531153 'key' : '211127' ,
11541154 'status' : 'Running' ,
@@ -1194,12 +1194,12 @@ def test_get_rollout_from_id__valid_rollout_id(self):
11941194 'id' : '211149'
11951195 }]
11961196 }])
1197- self .assertEqual (expected_rollout , project_config .get_rollout_from_id ('211111' ))
1197+ self .assertEqual (expected_layer , project_config .get_layer_from_id ('211111' ))
11981198
11991199 def test_get_variable_value_for_variation__returns_valid_value (self ):
12001200 """ Test that the right value and type are returned. """
1201- opt_obj = optimizely .Optimizely (json .dumps (self .config_dict_with_features ))
1202- project_config = opt_obj .config
1201+ optimizely_instance = optimizely .Optimizely (json .dumps (self .config_dict_with_features ))
1202+ project_config = optimizely_instance .config
12031203
12041204 variation = project_config .get_variation_from_id ('test_experiment' , '111128' )
12051205 is_working_variable = project_config .get_variable_for_feature ('test_feature_in_experiment' , 'is_working' )
@@ -1210,17 +1210,17 @@ def test_get_variable_value_for_variation__returns_valid_value(self):
12101210 def test_get_variable_value_for_variation__invalid_variable (self ):
12111211 """ Test that an invalid variable key will return None. """
12121212
1213- opt_obj = optimizely .Optimizely (json .dumps (self .config_dict_with_features ))
1214- project_config = opt_obj .config
1213+ optimizely_instance = optimizely .Optimizely (json .dumps (self .config_dict_with_features ))
1214+ project_config = optimizely_instance .config
12151215
12161216 variation = project_config .get_variation_from_id ('test_experiment' , '111128' )
12171217 self .assertIsNone (project_config .get_variable_value_for_variation (None , variation ))
12181218
12191219 def test_get_variable_value_for_variation__no_variables_for_variation (self ):
12201220 """ Test that a variation with no variables will return None. """
12211221
1222- opt_obj = optimizely .Optimizely (json .dumps (self .config_dict_with_features ))
1223- project_config = opt_obj .config
1222+ optimizely_instance = optimizely .Optimizely (json .dumps (self .config_dict_with_features ))
1223+ project_config = optimizely_instance .config
12241224
12251225 variation = entities .Variation ('1111281' , 'invalid_variation' , [])
12261226 is_working_variable = project_config .get_variable_for_feature ('test_feature_in_experiment' , 'is_working' )
@@ -1229,25 +1229,25 @@ def test_get_variable_value_for_variation__no_variables_for_variation(self):
12291229 def test_get_variable_for_feature__returns_valid_variable (self ):
12301230 """ Test that the feature variable is returned. """
12311231
1232- opt_obj = optimizely .Optimizely (json .dumps (self .config_dict_with_features ))
1233- project_config = opt_obj .config
1232+ optimizely_instance = optimizely .Optimizely (json .dumps (self .config_dict_with_features ))
1233+ project_config = optimizely_instance .config
12341234
12351235 variable = project_config .get_variable_for_feature ('test_feature_in_experiment' , 'is_working' )
12361236 self .assertEqual (entities .Variable ('127' , 'is_working' , 'boolean' , 'true' ), variable )
12371237
12381238 def test_get_variable_for_feature__invalid_feature_key (self ):
12391239 """ Test that an invalid feature key will return None. """
12401240
1241- opt_obj = optimizely .Optimizely (json .dumps (self .config_dict_with_features ))
1242- project_config = opt_obj .config
1241+ optimizely_instance = optimizely .Optimizely (json .dumps (self .config_dict_with_features ))
1242+ project_config = optimizely_instance .config
12431243
12441244 self .assertIsNone (project_config .get_variable_for_feature ('invalid_feature' , 'is_working' ))
12451245
12461246 def test_get_variable_for_feature__invalid_variable_key (self ):
12471247 """ Test that an invalid variable key will return None. """
12481248
1249- opt_obj = optimizely .Optimizely (json .dumps (self .config_dict_with_features ))
1250- project_config = opt_obj .config
1249+ optimizely_instance = optimizely .Optimizely (json .dumps (self .config_dict_with_features ))
1250+ project_config = optimizely_instance .config
12511251
12521252 self .assertIsNone (project_config .get_variable_for_feature ('test_feature_in_experiment' , 'invalid_variable_key' ))
12531253
0 commit comments