(self, mock_exists, mock_dirs)
| 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 | |
| 469 | class test_Cluster: |
nothing calls this directly
no test coverage detected