@@ -372,7 +372,6 @@ def on_custom_event(test_string):
372372
373373 def test_add_invalid_listener (self ):
374374 """ Test adding a invalid listener """
375- not_a_listener = "This is not a listener"
376375 self .assertEqual (0 , len (self .optimizely .notification_center .notifications [enums .NotificationTypes .TRACK ]))
377376
378377 def test_add_multi_listener (self ):
@@ -456,7 +455,7 @@ def test_track_listener_with_attr(self):
456455 with mock .patch ('optimizely.decision_service.DecisionService.get_variation' ,
457456 return_value = self .project_config .get_variation_from_id (
458457 'test_experiment' , '111128'
459- )) as mock_get_variation , \
458+ )), \
460459 mock .patch ('optimizely.event_dispatcher.EventDispatcher.dispatch_event' ) as mock_dispatch , \
461460 mock .patch ('optimizely.notification_center.NotificationCenter.send_notifications' ) as mock_event_tracked :
462461 self .optimizely .track ('test_event' , 'test_user' , attributes = {'test_attribute' : 'test_value' })
@@ -471,7 +470,7 @@ def test_track_listener_with_attr_with_event_tags(self):
471470 with mock .patch ('optimizely.decision_service.DecisionService.get_variation' ,
472471 return_value = self .project_config .get_variation_from_id (
473472 'test_experiment' , '111128'
474- )) as mock_get_variation , \
473+ )), \
475474 mock .patch ('optimizely.event_dispatcher.EventDispatcher.dispatch_event' ) as mock_dispatch , \
476475 mock .patch ('optimizely.notification_center.NotificationCenter.send_notifications' ) as mock_event_tracked :
477476 self .optimizely .track ('test_event' , 'test_user' , attributes = {'test_attribute' : 'test_value' },
@@ -506,7 +505,7 @@ def on_activate(experiment, user_id, attributes, variation, event):
506505 mock_variation ,
507506 decision_service .DECISION_SOURCE_EXPERIMENT
508507 )) as mock_decision , \
509- mock .patch ('optimizely.event_dispatcher.EventDispatcher.dispatch_event' ) as mock_dispatch_event , \
508+ mock .patch ('optimizely.event_dispatcher.EventDispatcher.dispatch_event' ), \
510509 mock .patch ('uuid.uuid4' , return_value = 'a68cf1ad-0393-4e18-af87-efe8f01a7c9c' ), \
511510 mock .patch ('time.time' , return_value = 42 ):
512511 self .assertTrue (opt_obj .is_feature_enabled ('test_feature_in_experiment' , 'test_user' ))
@@ -2558,7 +2557,7 @@ def test_get_variation__whitelisted_user_forced_bucketing(self):
25582557 def test_get_variation__user_profile__forced_bucketing (self ):
25592558 """ Test that the expected forced variation is called if a user profile exists """
25602559 with mock .patch ('optimizely.decision_service.DecisionService.get_stored_variation' ,
2561- return_value = entities .Variation ('111128' , 'control' )) as mock_get_stored_variation :
2560+ return_value = entities .Variation ('111128' , 'control' )):
25622561 self .assertTrue (self .optimizely .set_forced_variation ('test_experiment' , 'test_user' , 'variation' ))
25632562 self .assertEqual ('variation' , self .optimizely .get_forced_variation ('test_experiment' , 'test_user' ))
25642563 variation_key = self .optimizely .get_variation ('test_experiment' ,
0 commit comments