@@ -1852,7 +1852,7 @@ def test_get_variation(self):
18521852 'optimizely.decision_service.DecisionService.get_variation' ,
18531853 return_value = variation_result ,
18541854 ), 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' )
18561856 self .assertEqual (
18571857 'variation' , variation ,
18581858 )
@@ -1885,7 +1885,7 @@ def test_get_variation_lookup_and_save_is_called(self):
18851885 ) as mock_load_user_profile , mock .patch (
18861886 'optimizely.user_profile.UserProfileTracker.save_user_profile'
18871887 ) 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' )
18891889 self .assertEqual (
18901890 'variation' , variation ,
18911891 )
@@ -1917,7 +1917,7 @@ def test_get_variation_with_experiment_in_feature(self):
19171917 'optimizely.decision_service.DecisionService.get_variation' ,
19181918 return_value = variation_result ,
19191919 ), 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' )
19211921 self .assertEqual ('variation' , variation )
19221922
19231923 self .assertEqual (mock_broadcast .call_count , 1 )
@@ -1946,7 +1946,7 @@ def test_get_variation__returns_none(self):
19461946 None ,
19471947 self .optimizely .get_variation (
19481948 'test_experiment' , 'test_user' , attributes = {'test_attribute' : 'test_value' },
1949- )[ 'variation' ] ,
1949+ ),
19501950 )
19511951
19521952 self .assertEqual (mock_broadcast .call_count , 1 )
@@ -5283,7 +5283,7 @@ def test_get_variation__forced_bucketing(self):
52835283 )
52845284 variation_key = self .optimizely .get_variation (
52855285 'test_experiment' , 'test_user' , attributes = {'test_attribute' : 'test_value' }
5286- )[ 'variation' ]. key
5286+ )
52875287 self .assertEqual ('variation' , variation_key )
52885288
52895289 def test_get_variation__experiment_not_running__forced_bucketing (self ):
@@ -5298,7 +5298,7 @@ def test_get_variation__experiment_not_running__forced_bucketing(self):
52985298 )
52995299 variation_key = self .optimizely .get_variation (
53005300 'test_experiment' , 'test_user' , attributes = {'test_attribute' : 'test_value' },
5301- )[ 'variation' ]
5301+ )
53025302 self .assertIsNone (variation_key )
53035303 mock_is_experiment_running .assert_called_once_with (
53045304 self .project_config .get_experiment_from_key ('test_experiment' )
@@ -5312,7 +5312,7 @@ def test_get_variation__whitelisted_user_forced_bucketing(self):
53125312 self .assertEqual ('group_exp_1_variation' , forced_variation )
53135313 variation_key = self .optimizely .get_variation (
53145314 'group_exp_1' , 'user_1' , attributes = {'test_attribute' : 'test_value' }
5315- )[ 'variation' ]. key
5315+ )
53165316 self .assertEqual ('group_exp_1_variation' , variation_key )
53175317
53185318 def test_get_variation__user_profile__forced_bucketing (self ):
@@ -5327,7 +5327,7 @@ def test_get_variation__user_profile__forced_bucketing(self):
53275327 )
53285328 variation_key = self .optimizely .get_variation (
53295329 'test_experiment' , 'test_user' , attributes = {'test_attribute' : 'test_value' },
5330- )[ 'variation' ]. key
5330+ )
53315331 self .assertEqual ('variation' , variation_key )
53325332
53335333 def test_get_variation__invalid_attributes__forced_bucketing (self ):
@@ -5339,7 +5339,8 @@ def test_get_variation__invalid_attributes__forced_bucketing(self):
53395339 )
53405340 variation_key = self .optimizely .get_variation (
53415341 'test_experiment' , 'test_user' , attributes = {'test_attribute' : 'test_value_invalid' },
5342- )['variation' ].key
5342+ )
5343+ variation_key = variation_key
53435344 self .assertEqual ('variation' , variation_key )
53445345
53455346 def test_set_forced_variation__invalid_object (self ):
0 commit comments