@@ -1852,7 +1852,7 @@ def test_get_variation(self):
1852
1852
'optimizely.decision_service.DecisionService.get_variation' ,
1853
1853
return_value = variation_result ,
1854
1854
), mock .patch ('optimizely.notification_center.NotificationCenter.send_notifications' ) as mock_broadcast :
1855
- variation = self .optimizely .get_variation ('test_experiment' , 'test_user' )[ 'variation' ]. key
1855
+ variation = self .optimizely .get_variation ('test_experiment' , 'test_user' )
1856
1856
self .assertEqual (
1857
1857
'variation' , variation ,
1858
1858
)
@@ -1885,7 +1885,7 @@ def test_get_variation_lookup_and_save_is_called(self):
1885
1885
) as mock_load_user_profile , mock .patch (
1886
1886
'optimizely.user_profile.UserProfileTracker.save_user_profile'
1887
1887
) as mock_save_user_profile :
1888
- variation = self .optimizely .get_variation ('test_experiment' , 'test_user' )[ 'variation' ]. key
1888
+ variation = self .optimizely .get_variation ('test_experiment' , 'test_user' )
1889
1889
self .assertEqual (
1890
1890
'variation' , variation ,
1891
1891
)
@@ -1917,7 +1917,7 @@ def test_get_variation_with_experiment_in_feature(self):
1917
1917
'optimizely.decision_service.DecisionService.get_variation' ,
1918
1918
return_value = variation_result ,
1919
1919
), mock .patch ('optimizely.notification_center.NotificationCenter.send_notifications' ) as mock_broadcast :
1920
- variation = opt_obj .get_variation ('test_experiment' , 'test_user' )[ 'variation' ]. key
1920
+ variation = opt_obj .get_variation ('test_experiment' , 'test_user' )
1921
1921
self .assertEqual ('variation' , variation )
1922
1922
1923
1923
self .assertEqual (mock_broadcast .call_count , 1 )
@@ -1946,7 +1946,7 @@ def test_get_variation__returns_none(self):
1946
1946
None ,
1947
1947
self .optimizely .get_variation (
1948
1948
'test_experiment' , 'test_user' , attributes = {'test_attribute' : 'test_value' },
1949
- )[ 'variation' ] ,
1949
+ ),
1950
1950
)
1951
1951
1952
1952
self .assertEqual (mock_broadcast .call_count , 1 )
@@ -5172,7 +5172,7 @@ def test_get_variation__forced_bucketing(self):
5172
5172
)
5173
5173
variation_key = self .optimizely .get_variation (
5174
5174
'test_experiment' , 'test_user' , attributes = {'test_attribute' : 'test_value' }
5175
- )[ 'variation' ]. key
5175
+ )
5176
5176
self .assertEqual ('variation' , variation_key )
5177
5177
5178
5178
def test_get_variation__experiment_not_running__forced_bucketing (self ):
@@ -5187,7 +5187,7 @@ def test_get_variation__experiment_not_running__forced_bucketing(self):
5187
5187
)
5188
5188
variation_key = self .optimizely .get_variation (
5189
5189
'test_experiment' , 'test_user' , attributes = {'test_attribute' : 'test_value' },
5190
- )[ 'variation' ]
5190
+ )
5191
5191
self .assertIsNone (variation_key )
5192
5192
mock_is_experiment_running .assert_called_once_with (
5193
5193
self .project_config .get_experiment_from_key ('test_experiment' )
@@ -5201,7 +5201,7 @@ def test_get_variation__whitelisted_user_forced_bucketing(self):
5201
5201
self .assertEqual ('group_exp_1_variation' , forced_variation )
5202
5202
variation_key = self .optimizely .get_variation (
5203
5203
'group_exp_1' , 'user_1' , attributes = {'test_attribute' : 'test_value' }
5204
- )[ 'variation' ]. key
5204
+ )
5205
5205
self .assertEqual ('group_exp_1_variation' , variation_key )
5206
5206
5207
5207
def test_get_variation__user_profile__forced_bucketing (self ):
@@ -5216,7 +5216,7 @@ def test_get_variation__user_profile__forced_bucketing(self):
5216
5216
)
5217
5217
variation_key = self .optimizely .get_variation (
5218
5218
'test_experiment' , 'test_user' , attributes = {'test_attribute' : 'test_value' },
5219
- )[ 'variation' ]. key
5219
+ )
5220
5220
self .assertEqual ('variation' , variation_key )
5221
5221
5222
5222
def test_get_variation__invalid_attributes__forced_bucketing (self ):
@@ -5228,7 +5228,8 @@ def test_get_variation__invalid_attributes__forced_bucketing(self):
5228
5228
)
5229
5229
variation_key = self .optimizely .get_variation (
5230
5230
'test_experiment' , 'test_user' , attributes = {'test_attribute' : 'test_value_invalid' },
5231
- )['variation' ].key
5231
+ )
5232
+ variation_key = variation_key
5232
5233
self .assertEqual ('variation' , variation_key )
5233
5234
5234
5235
def test_set_forced_variation__invalid_object (self ):
0 commit comments