Replace argh with click.

This commit is contained in:
Simon Conseil
2014-07-22 23:59:53 +02:00
parent 4724a3295f
commit e7f9f91636
5 changed files with 56 additions and 43 deletions

View File

@@ -1,10 +1,20 @@
# -*- coding: utf-8 -*-
import os
from click.testing import CliRunner
from sigal import init
def test_init(tmpdir):
config_file = str(tmpdir.join('sigal.conf.py'))
init(path=config_file)
runner = CliRunner()
result = runner.invoke(init, [config_file])
assert result.exit_code == 0
assert result.output.startswith('Sample config file created:')
assert os.path.isfile(config_file)
result = runner.invoke(init, [config_file])
assert result.exit_code == 1
assert result.output == ("Found an existing config file, will abort to "
"keep it safe.\n")