@@ -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 )
@@ -5283,7 +5283,7 @@ def test_get_variation__forced_bucketing(self):
5283
5283
)
5284
5284
variation_key = self .optimizely .get_variation (
5285
5285
'test_experiment' , 'test_user' , attributes = {'test_attribute' : 'test_value' }
5286
- )[ 'variation' ]. key
5286
+ )
5287
5287
self .assertEqual ('variation' , variation_key )
5288
5288
5289
5289
def test_get_variation__experiment_not_running__forced_bucketing (self ):
@@ -5298,7 +5298,7 @@ def test_get_variation__experiment_not_running__forced_bucketing(self):
5298
5298
)
5299
5299
variation_key = self .optimizely .get_variation (
5300
5300
'test_experiment' , 'test_user' , attributes = {'test_attribute' : 'test_value' },
5301
- )[ 'variation' ]
5301
+ )
5302
5302
self .assertIsNone (variation_key )
5303
5303
mock_is_experiment_running .assert_called_once_with (
5304
5304
self .project_config .get_experiment_from_key ('test_experiment' )
@@ -5312,7 +5312,7 @@ def test_get_variation__whitelisted_user_forced_bucketing(self):
5312
5312
self .assertEqual ('group_exp_1_variation' , forced_variation )
5313
5313
variation_key = self .optimizely .get_variation (
5314
5314
'group_exp_1' , 'user_1' , attributes = {'test_attribute' : 'test_value' }
5315
- )[ 'variation' ]. key
5315
+ )
5316
5316
self .assertEqual ('group_exp_1_variation' , variation_key )
5317
5317
5318
5318
def test_get_variation__user_profile__forced_bucketing (self ):
@@ -5327,7 +5327,7 @@ def test_get_variation__user_profile__forced_bucketing(self):
5327
5327
)
5328
5328
variation_key = self .optimizely .get_variation (
5329
5329
'test_experiment' , 'test_user' , attributes = {'test_attribute' : 'test_value' },
5330
- )[ 'variation' ]. key
5330
+ )
5331
5331
self .assertEqual ('variation' , variation_key )
5332
5332
5333
5333
def test_get_variation__invalid_attributes__forced_bucketing (self ):
@@ -5339,7 +5339,8 @@ def test_get_variation__invalid_attributes__forced_bucketing(self):
5339
5339
)
5340
5340
variation_key = self .optimizely .get_variation (
5341
5341
'test_experiment' , 'test_user' , attributes = {'test_attribute' : 'test_value_invalid' },
5342
- )['variation' ].key
5342
+ )
5343
+ variation_key = variation_key
5343
5344
self .assertEqual ('variation' , variation_key )
5344
5345
5345
5346
def test_set_forced_variation__invalid_object (self ):
0 commit comments