def test_start_scheduler_without_cache_in_configuration(mock): from papaye import start_scheduler from papaye.tasks.devices import DummyScheduler config = Configurator() config.registry.settings = { 'papaye.cache': 'true', } start_scheduler(config) get_current_request() assert isinstance(mock.call_args[0][0], DummyScheduler)
def test_start_scheduler(mock): from papaye import start_scheduler config = Configurator() config.registry.settings = { 'papaye.cache': 'true', 'papaye.scheduler': 'papaye.tests.test_config:TestScheduler', } start_scheduler(config) get_current_request() assert isinstance(mock.call_args[0][0], TestScheduler)