Esempio n. 1
0
 def test_additional_context(self):
     "Pass additional context to the template."
     supervisor.upload_celery_conf(context={'foo': 'bar'})
     self.assertTemplateContext({
         'app_name': 'celeryd',
         'command': 'celeryd',
         'foo': 'bar'
     })
Esempio n. 2
0
 def test_alternate_app_name(self):
     "Use another app name for the celeryd command."
     supervisor.upload_celery_conf(app_name='worker-2')
     self.assertTemplateContext({
         'app_name': 'worker-2',
         'command': 'celeryd'
     })
     self.assertTemplateUsed(
         [u'supervisor/celeryd.conf', u'supervisor/celery.conf'])
     self.assertTemplateDesination(u'/etc/supervisor/conf.d/worker-2.conf')
Esempio n. 3
0
 def test_alternate_command(self):
     "Upload template for another celery command."
     supervisor.upload_celery_conf(command='celerybeat')
     self.assertTemplateContext({
         'app_name': 'celerybeat',
         'command': 'celerybeat'
     })
     self.assertTemplateUsed(
         [u'supervisor/celerybeat.conf', u'supervisor/celery.conf'])
     self.assertTemplateDesination(
         u'/etc/supervisor/conf.d/celerybeat.conf')
Esempio n. 4
0
 def test_default_upload(self):
     "Upload default configuration."
     supervisor.upload_celery_conf()
     # Default context
     self.assertTemplateContext({
         'app_name': 'celeryd',
         'command': 'celeryd'
     })
     # Upload template will look for templates in the given order
     self.assertTemplateUsed(
         [u'supervisor/celeryd.conf', u'supervisor/celery.conf'])
     self.assertTemplateDesination(u'/etc/supervisor/conf.d/celeryd.conf')
     self.assertSudoCommand('supervisorctl update')
Esempio n. 5
0
 def test_alternate_template_name(self):
     "Change default template search."
     supervisor.upload_celery_conf(template_name=u'bar.conf')
     self.assertTemplateUsed(u'bar.conf')
     self.assertTemplateDesination(u'/etc/supervisor/conf.d/celeryd.conf')