1
- # Copyright 2016-2019 , Optimizely
1
+ # Copyright 2016-2020 , Optimizely
2
2
# Licensed under the Apache License, Version 2.0 (the "License");
3
3
# you may not use this file except in compliance with the License.
4
4
# 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
140
140
)
141
141
)
142
142
143
- def test_is_user_in_experiment__evaluates_audienceIds (self ):
143
+ def test_is_user_in_experiment__evaluates_audience_ids (self ):
144
144
""" Test that is_user_in_experiment correctly evaluates audience Ids and
145
145
calls custom attribute evaluator for leaf nodes. """
146
146
@@ -241,7 +241,7 @@ def test_is_user_in_experiment__with_no_audience(self):
241
241
]
242
242
)
243
243
244
- def test_is_user_in_experiment__evaluates_audienceIds (self ):
244
+ def test_is_user_in_experiment__evaluates_audience_ids (self ):
245
245
user_attributes = {'test_attribute' : 'test_value_1' }
246
246
experiment = self .project_config .get_experiment_from_key ('test_experiment' )
247
247
experiment .audienceIds = ['11154' , '11159' ]
@@ -256,20 +256,20 @@ def test_is_user_in_experiment__evaluates_audienceIds(self):
256
256
self .project_config , experiment , user_attributes , self .mock_client_logger ,
257
257
)
258
258
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 )
261
261
262
262
self .mock_client_logger .assert_has_calls (
263
263
[
264
264
mock .call .debug ('Evaluating audiences for experiment "test_experiment": ["11154", "11159"].' ),
265
265
mock .call .debug (
266
266
'Starting to evaluate audience "11154" with conditions: ' + audience_11154 .conditions + '.'
267
267
),
268
- mock .call .info ('Audience "11154" evaluated to UNKNOWN.' ),
268
+ mock .call .debug ('Audience "11154" evaluated to UNKNOWN.' ),
269
269
mock .call .debug (
270
270
'Starting to evaluate audience "11159" with conditions: ' + audience_11159 .conditions + '.'
271
271
),
272
- mock .call .info ('Audience "11159" evaluated to UNKNOWN.' ),
272
+ mock .call .debug ('Audience "11159" evaluated to UNKNOWN.' ),
273
273
mock .call .info ('Audiences for experiment "test_experiment" collectively evaluated to FALSE.' ),
274
274
]
275
275
)
@@ -292,8 +292,8 @@ def test_is_user_in_experiment__evaluates_audience_conditions(self):
292
292
):
293
293
audience .is_user_in_experiment (project_config , experiment , {}, self .mock_client_logger )
294
294
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 )
297
297
298
298
self .mock_client_logger .assert_has_calls (
299
299
[
@@ -306,17 +306,17 @@ def test_is_user_in_experiment__evaluates_audience_conditions(self):
306
306
'Starting to evaluate audience "3468206642" with '
307
307
'conditions: ' + audience_3468206642 .conditions + '.'
308
308
),
309
- mock .call .info ('Audience "3468206642" evaluated to FALSE.' ),
309
+ mock .call .debug ('Audience "3468206642" evaluated to FALSE.' ),
310
310
mock .call .debug (
311
311
'Starting to evaluate audience "3988293898" with '
312
312
'conditions: ' + audience_3988293898 .conditions + '.'
313
313
),
314
- mock .call .info ('Audience "3988293898" evaluated to UNKNOWN.' ),
314
+ mock .call .debug ('Audience "3988293898" evaluated to UNKNOWN.' ),
315
315
mock .call .debug (
316
316
'Starting to evaluate audience "3988293899" with '
317
317
'conditions: ' + audience_3988293899 .conditions + '.'
318
318
),
319
- mock .call .info ('Audience "3988293899" evaluated to TRUE.' ),
319
+ mock .call .debug ('Audience "3988293899" evaluated to TRUE.' ),
320
320
mock .call .info (
321
321
'Audiences for experiment "audience_combinations_experiment" collectively evaluated to TRUE.'
322
322
),
0 commit comments