Commit a934e17a authored by Theophile GENTILHOMME's avatar Theophile GENTILHOMME

Add more constraining test

parent 0f565efd
## Configuration file automatically generated at 05/07/2018 for cli test.
## Path leading to test blablabla.
## Option: -t, --test [default: /my/path/test.txt]
# test = /my/path/test.txt
import click
import pkg_resources
from click.testing import CliRunner
from bob.extension.scripts.click_helper import (
verbosity_option, bool_option, list_float_option,
......@@ -178,7 +179,7 @@ def test_config_dump():
def cli():
@click.option('-t', '--test', required=True, default="/my/path/test.txt",
help="Path leading to test blablabla", cls=ResourceOption)
......@@ -186,5 +187,9 @@ def test_config_dump():
runner = CliRunner()
with runner.isolated_filesystem():
result = runner.invoke(cli, ['test', '-dc', 'TEST_CONF'], catch_exceptions=False)
assert result.exit_code != 0, (result.exit_code, result.output)
result = runner.invoke(cli, ['test', '-H', 'TEST_CONF'], catch_exceptions=False)
ref = pkg_resources.resource_filename('bob.extension',
assert result.exit_code == 0, (result.exit_code, result.output)
with open('TEST_CONF', 'r') as f, open(ref, 'r') as f2:
assert ==
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment