1- # Copyright 2016-2019 , Optimizely
1+ # Copyright 2016-2020 , Optimizely
22# Licensed under the Apache License, Version 2.0 (the "License");
33# you may not use this file except in compliance with the License.
44# You may obtain a copy of the License at
@@ -140,7 +140,7 @@ def test_is_user_in_experiment__returns_False__when_condition_tree_evaluator_ret
140140 )
141141 )
142142
143- def test_is_user_in_experiment__evaluates_audienceIds (self ):
143+ def test_is_user_in_experiment__evaluates_audience_ids (self ):
144144 """ Test that is_user_in_experiment correctly evaluates audience Ids and
145145 calls custom attribute evaluator for leaf nodes. """
146146
@@ -241,7 +241,7 @@ def test_is_user_in_experiment__with_no_audience(self):
241241 ]
242242 )
243243
244- def test_is_user_in_experiment__evaluates_audienceIds (self ):
244+ def test_is_user_in_experiment__evaluates_audience_ids (self ):
245245 user_attributes = {'test_attribute' : 'test_value_1' }
246246 experiment = self .project_config .get_experiment_from_key ('test_experiment' )
247247 experiment .audienceIds = ['11154' , '11159' ]
@@ -256,20 +256,20 @@ def test_is_user_in_experiment__evaluates_audienceIds(self):
256256 self .project_config , experiment , user_attributes , self .mock_client_logger ,
257257 )
258258
259- self .assertEqual (3 , self .mock_client_logger .debug .call_count )
260- self .assertEqual (3 , self .mock_client_logger .info .call_count )
259+ self .assertEqual (5 , self .mock_client_logger .debug .call_count )
260+ self .assertEqual (1 , self .mock_client_logger .info .call_count )
261261
262262 self .mock_client_logger .assert_has_calls (
263263 [
264264 mock .call .debug ('Evaluating audiences for experiment "test_experiment": ["11154", "11159"].' ),
265265 mock .call .debug (
266266 'Starting to evaluate audience "11154" with conditions: ' + audience_11154 .conditions + '.'
267267 ),
268- mock .call .info ('Audience "11154" evaluated to UNKNOWN.' ),
268+ mock .call .debug ('Audience "11154" evaluated to UNKNOWN.' ),
269269 mock .call .debug (
270270 'Starting to evaluate audience "11159" with conditions: ' + audience_11159 .conditions + '.'
271271 ),
272- mock .call .info ('Audience "11159" evaluated to UNKNOWN.' ),
272+ mock .call .debug ('Audience "11159" evaluated to UNKNOWN.' ),
273273 mock .call .info ('Audiences for experiment "test_experiment" collectively evaluated to FALSE.' ),
274274 ]
275275 )
@@ -292,8 +292,8 @@ def test_is_user_in_experiment__evaluates_audience_conditions(self):
292292 ):
293293 audience .is_user_in_experiment (project_config , experiment , {}, self .mock_client_logger )
294294
295- self .assertEqual (4 , self .mock_client_logger .debug .call_count )
296- self .assertEqual (4 , self .mock_client_logger .info .call_count )
295+ self .assertEqual (7 , self .mock_client_logger .debug .call_count )
296+ self .assertEqual (1 , self .mock_client_logger .info .call_count )
297297
298298 self .mock_client_logger .assert_has_calls (
299299 [
@@ -306,17 +306,17 @@ def test_is_user_in_experiment__evaluates_audience_conditions(self):
306306 'Starting to evaluate audience "3468206642" with '
307307 'conditions: ' + audience_3468206642 .conditions + '.'
308308 ),
309- mock .call .info ('Audience "3468206642" evaluated to FALSE.' ),
309+ mock .call .debug ('Audience "3468206642" evaluated to FALSE.' ),
310310 mock .call .debug (
311311 'Starting to evaluate audience "3988293898" with '
312312 'conditions: ' + audience_3988293898 .conditions + '.'
313313 ),
314- mock .call .info ('Audience "3988293898" evaluated to UNKNOWN.' ),
314+ mock .call .debug ('Audience "3988293898" evaluated to UNKNOWN.' ),
315315 mock .call .debug (
316316 'Starting to evaluate audience "3988293899" with '
317317 'conditions: ' + audience_3988293899 .conditions + '.'
318318 ),
319- mock .call .info ('Audience "3988293899" evaluated to TRUE.' ),
319+ mock .call .debug ('Audience "3988293899" evaluated to TRUE.' ),
320320 mock .call .info (
321321 'Audiences for experiment "audience_combinations_experiment" collectively evaluated to TRUE.'
322322 ),
0 commit comments