예제 #1
0
 def test_convert_to_celery_options_of_any(self):
     config = {'CELERY_ACCEPT_CONTENT': '["application.json"]'}
     celery_config = convert_to_celery_options(config)
     self.assertEqual(celery_config['CELERY_ACCEPT_CONTENT'], ["application.json"])
예제 #2
0
 def test_convert_to_celery_options_of_BROKER_USE_SSL(self):
     config = {'BROKER_USE_SSL': '{"key":"value"}'}
     celery_config = convert_to_celery_options(config)
     self.assertEqual(celery_config['BROKER_USE_SSL']['key'], 'value')
예제 #3
0
 def test_convert_to_celery_options_of_dict(self):
     config = {'CELERY_QUEUES': '{"key":"value"}'}
     celery_config = convert_to_celery_options(config)
     self.assertEqual(celery_config['CELERY_QUEUES']['key'], "value")
예제 #4
0
 def test_convert_to_celery_options_of_list(self):
     config = {'CASSANDRA_SERVERS': '[1,2]'}
     celery_config = convert_to_celery_options(config)
     self.assertListEqual(celery_config['CASSANDRA_SERVERS'], [1, 2])
예제 #5
0
 def test_convert_to_celery_options_of_bool(self):
     config = {'CELERY_TRACK_STARTED': 'False'}
     celery_config = convert_to_celery_options(config)
     self.assertEqual(celery_config['CELERY_TRACK_STARTED'], False)
예제 #6
0
 def test_convert_to_celery_options_of_string(self):
     config = {'CELERY_TIMEZONE': 'eastern'}
     celery_config = convert_to_celery_options(config)
     self.assertEqual(celery_config['CELERY_TIMEZONE'], 'eastern')
예제 #7
0
 def test_convert_to_celery_options_of_float(self):
     config = {'CELERY_TASK_RESULT_EXPIRES': '1.234'}
     celery_config = convert_to_celery_options(config)
     self.assertEqual(celery_config['CELERY_TASK_RESULT_EXPIRES'], 1.234)
예제 #8
0
 def test_convert_to_celery_options_of_int(self):
     config = {'CELERY_MAX_CACHED_RESULTS': '24'}
     celery_config = convert_to_celery_options(config)
     self.assertEqual(celery_config['CELERY_MAX_CACHED_RESULTS'], 24)
예제 #9
0
 def test_convert_to_celery_options_of_tuple(self):
     config = {'CELERY_IMPORTS': '("tasks", "moretasks")'}
     celery_config = convert_to_celery_options(config)
     self.assertTupleEqual(celery_config['CELERY_IMPORTS'], ("tasks", "moretasks"))