Esempio n. 1
0
def test_on_future_errors_cancelled():
    manager = LoaferManager(routes=[])
    manager.runner = mock.Mock()
    future = asyncio.Future()
    future.cancel()
    manager.on_future__errors(future)

    assert manager.runner.prepare_stop.called
    manager.runner.prepare_stop.assert_called_once_with()
Esempio n. 2
0
def test_on_future_errors():
    manager = LoaferManager(routes=[])
    manager.runner = mock.Mock()
    future = asyncio.Future()
    future.set_exception(ProviderError)
    manager.on_future__errors(future)

    assert manager.runner.prepare_stop.called
    manager.runner.prepare_stop.assert_called_once_with()