def test_runner_start_and_stop(): runner = LoaferRunner(loop=mock.Mock()) runner.stop = mock.Mock() runner.start(run_forever=False) assert runner.loop.run_forever.called assert runner.stop.called assert runner.loop.close.called
def test_runner_start_and_stop(): runner = LoaferRunner(loop=mock.Mock()) runner.stop = mock.Mock() runner.start(run_forever=False) assert runner.loop.run_forever.called assert runner.stop.called assert runner.loop.close.called
def test_runner_start_and_stop(loop_mock): runner = LoaferRunner() runner.stop = mock.Mock() runner.start() assert runner.stop.called assert loop_mock.return_value.run_forever.called assert loop_mock.return_value.close.called
def test_runner_start(loop_mock): runner = LoaferRunner() runner.start() assert loop_mock.return_value.run_forever.called
def test_runner_start_with_debug(loop_mock): runner = LoaferRunner() runner.start(debug=True) loop_mock.return_value.set_debug.assert_called_once_with(enabled=True)
def test_runner_start(): runner = LoaferRunner(loop=mock.Mock()) runner.start() assert runner.loop.run_forever.called
def test_runner_with_cancelled_error(): runner = LoaferRunner(loop=mock.Mock()) runner.loop.run_forever.side_effect = CancelledError runner.start() assert runner.loop.run_forever.called assert runner.loop.close.called
def test_runner_start_run_until_complete(): runner = LoaferRunner(loop=mock.Mock()) runner.stop = mock.Mock() runner.start(run_forever=False) assert runner.loop.run_until_complete.called assert runner.stop.called
def test_runner_start_with_debug(): loop = mock.Mock() runner = LoaferRunner(loop=loop) runner.start(debug=True) loop.set_debug.assert_called_once_with(enabled=True)
def test_runner_start_with_debug(): loop = mock.Mock() runner = LoaferRunner(loop=loop) runner.start(debug=True) assert loop.set_debug.called_once_with(enabled=True)