MCPcopy Create free account
hub / github.com/celery/celery / test_pidfile_custom

Method test_pidfile_custom

t/unit/apps/test_multi.py:451–466  ·  view source on GitHub ↗
(self, mock_exists, mock_dirs)

Source from the content-addressed store, hash-verified

449 @patch('celery.apps.multi.os.makedirs')
450 @patch('celery.apps.multi.os.path.exists', return_value=False)
451 def test_pidfile_custom(self, mock_exists, mock_dirs):
452 n = Node.from_kwargs(
453 'foo@bar.com',
454 pidfile='/var/run/demo/celery/%n.pid'
455 )
456 assert n.options['--pidfile'] == '/var/run/demo/celery/%n.pid'
457
458 try:
459 mock_exists.assert_any_call('/var/run/celery')
460 except AssertionError:
461 pass
462 else:
463 raise AssertionError("Expected exists('/var/run/celery') to not have been called.")
464
465 mock_exists.assert_any_call('/var/run/demo/celery')
466 mock_dirs.assert_any_call('/var/run/demo/celery')
467
468
469class test_Cluster:

Callers

nothing calls this directly

Calls 1

from_kwargsMethod · 0.80

Tested by

no test coverage detected