From 65a845c7ca4350da09666bf246de5fffc7327705 Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Wed, 18 Jun 2014 20:00:06 +0200 Subject: [PATCH] Add one more test --- tests/test_cli.py | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/tests/test_cli.py b/tests/test_cli.py index 5953ca2..91a0e28 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -129,7 +129,6 @@ def test_parse_pairs_args(): def test_simple_run(tmpdir): - runner = CliRunner() config_file = tmpdir.join('config') config_file.write(dedent(''' [general] @@ -150,9 +149,37 @@ def test_simple_run(tmpdir): fileext = .txt ''').format(str(tmpdir))) + runner = CliRunner() result = runner.invoke( cli.app, ['sync'], env={'VDIRSYNCER_CONFIG': str(config_file)} ) assert not result.exception assert result.output.lower().strip() == 'syncing my_pair' + + +def test_missing_general_section(tmpdir): + config_file = tmpdir.join('config') + config_file.write(dedent(''' + [pair my_pair] + a = my_a + b = my_b + + [storage my_a] + type = filesystem + path = {0}/path_a/ + fileext = .txt + + [storage my_b] + type = filesystem + path = {0}/path_b/ + fileext = .txt + ''').format(str(tmpdir))) + + runner = CliRunner() + result = runner.invoke( + cli.app, ['sync'], + env={'VDIRSYNCER_CONFIG': str(config_file)} + ) + assert result.exception + assert 'unable to find general section' in result.output.lower()