File tree Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -299,7 +299,6 @@ def _run(self):
299
299
try :
300
300
while self .is_running :
301
301
self .fetch_datafile ()
302
- self .logger .debug ("This thread is running" )
303
302
time .sleep (self .update_interval )
304
303
except (OSError , OverflowError ) as err :
305
304
self .logger .error ('Error in time.sleep. '
Original file line number Diff line number Diff line change 14
14
import json
15
15
import mock
16
16
import requests
17
- from six .moves import queue
18
17
19
18
from optimizely import config_manager
20
19
from optimizely import exceptions as optimizely_exceptions
@@ -279,15 +278,7 @@ def test_fetch_datafile(self, _):
279
278
280
279
def test_is_running (self , _ ):
281
280
""" Test that polling thread is running after instance of PollingConfigManager is created. """
282
- blocking_queue = queue .Queue ()
283
- with mock .patch ('optimizely.config_manager.PollingConfigManager.fetch_datafile' ,
284
- side_effect = lambda : blocking_queue .put_nowait ('fetch_datafile called' )) as mock_fetch_datafile :
285
- project_config_manager = config_manager .PollingConfigManager (
286
- sdk_key = 'some_key' , update_interval = 1 )
287
-
288
- self .assertTrue (project_config_manager .is_running )
289
- # Wait for 5 seconds before asserting mock
290
- try :
291
- blocking_queue .get (True , 5 )
292
- except queue .Empty :
293
- mock_fetch_datafile .assert_called_with ()
281
+ with mock .patch ('optimizely.config_manager.PollingConfigManager.fetch_datafile' ) as mock_fetch_datafile :
282
+ project_config_manager = config_manager .PollingConfigManager (sdk_key = 'some_key' )
283
+ self .assertTrue (project_config_manager .is_running )
284
+ mock_fetch_datafile .assert_called_with ()
You can’t perform that action at this time.
0 commit comments