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

Method test_ensure_started_not_started

t/unit/utils/test_timer2.py:55–65  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

53 t.call_after.assert_called_with(0.3, sys.exit, 10)
54
55 def test_ensure_started_not_started(self):
56 t = timer2.Timer()
57 t.running = True
58 t.start = Mock()
59 t.ensure_started()
60 t.start.assert_not_called()
61 t.running = False
62 t.on_start = Mock()
63 t.ensure_started()
64 t.on_start.assert_called_with(t)
65 t.start.assert_called_with()
66
67 @patch('celery.utils.timer2.sleep')
68 @patch('os._exit') # To ensure the test fails gracefully

Callers

nothing calls this directly

Calls 1

ensure_startedMethod · 0.95

Tested by

no test coverage detected