Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aliabbasrizvi committed Jun 18, 2020
1 parent 1aa9961 commit 55a7261
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/test_optimizely.py
Original file line number Diff line number Diff line change
Expand Up @@ -1094,10 +1094,13 @@ def test_activate__whitelisting_overrides_audience_check(self):
def test_activate__bucketer_returns_none(self):
""" Test that activate returns None and does not process event when user is in no variation. """

with mock.patch('optimizely.helpers.audience.does_user_meet_audience_conditions',
return_value=True),\
mock.patch('optimizely.bucketer.Bucketer.bucket', return_value=None) as mock_bucket, \
mock.patch('optimizely.event.event_processor.ForwardingEventProcessor.process') as mock_process:
with mock.patch(
'optimizely.helpers.audience.does_user_meet_audience_conditions',
return_value=True), mock.patch(
'optimizely.bucketer.Bucketer.bucket',
return_value=None) as mock_bucket, mock.patch(
'optimizely.event.event_processor.ForwardingEventProcessor.process'
) as mock_process:
self.assertIsNone(
self.optimizely.activate('test_experiment', 'test_user', attributes={'test_attribute': 'test_value'},)
)
Expand Down

0 comments on commit 55a7261

Please sign in to comment.