mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-03-25 08:55:50 +00:00
parent
391f193eae
commit
bd6bca6540
2 changed files with 18 additions and 0 deletions
|
|
@ -408,3 +408,12 @@ def test_unknown_storage(tmpdir, runner, existing, missing):
|
|||
"These are the configured storages: ['{existing}']"
|
||||
.format(missing=missing, existing=existing)
|
||||
) in result.output
|
||||
|
||||
|
||||
@pytest.mark.parametrize('cmd', ['sync', 'metasync'])
|
||||
def test_no_configured_pairs(tmpdir, runner, cmd):
|
||||
runner.write_with_general('')
|
||||
|
||||
result = runner.invoke([cmd])
|
||||
assert result.output == 'critical: Nothing to do.\n'
|
||||
assert result.exception.code == 5
|
||||
|
|
|
|||
|
|
@ -459,8 +459,17 @@ class WorkerQueue(object):
|
|||
assert self._workers or not self._queue.unfinished_tasks
|
||||
ui_worker = click_threading.UiWorker()
|
||||
self._shutdown_handlers.append(ui_worker.shutdown)
|
||||
_echo = click.echo
|
||||
|
||||
with ui_worker.patch_click():
|
||||
yield
|
||||
|
||||
if not self._workers:
|
||||
# Ugly hack, needed because ui_worker is not running.
|
||||
click.echo = _echo
|
||||
cli_logger.critical('Nothing to do.')
|
||||
sys.exit(5)
|
||||
|
||||
ui_worker.run()
|
||||
self._queue.join()
|
||||
for worker in self._workers:
|
||||
|
|
|
|||
Loading…
Reference in a new issue