mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +00:00
Add one more test
This commit is contained in:
parent
a300c8c222
commit
65a845c7ca
1 changed files with 28 additions and 1 deletions
|
|
@ -129,7 +129,6 @@ def test_parse_pairs_args():
|
||||||
|
|
||||||
|
|
||||||
def test_simple_run(tmpdir):
|
def test_simple_run(tmpdir):
|
||||||
runner = CliRunner()
|
|
||||||
config_file = tmpdir.join('config')
|
config_file = tmpdir.join('config')
|
||||||
config_file.write(dedent('''
|
config_file.write(dedent('''
|
||||||
[general]
|
[general]
|
||||||
|
|
@ -150,9 +149,37 @@ def test_simple_run(tmpdir):
|
||||||
fileext = .txt
|
fileext = .txt
|
||||||
''').format(str(tmpdir)))
|
''').format(str(tmpdir)))
|
||||||
|
|
||||||
|
runner = CliRunner()
|
||||||
result = runner.invoke(
|
result = runner.invoke(
|
||||||
cli.app, ['sync'],
|
cli.app, ['sync'],
|
||||||
env={'VDIRSYNCER_CONFIG': str(config_file)}
|
env={'VDIRSYNCER_CONFIG': str(config_file)}
|
||||||
)
|
)
|
||||||
assert not result.exception
|
assert not result.exception
|
||||||
assert result.output.lower().strip() == 'syncing my_pair'
|
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()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue