Exemplo n.º 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"])
Exemplo n.º 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')
Exemplo n.º 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")
Exemplo n.º 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])
Exemplo n.º 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)
Exemplo n.º 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')
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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"))