Skip to content

Commit

Permalink
Added basic tests for the CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
gijswobben committed Jun 25, 2020
1 parent 81cedcd commit afec1e1
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/test_cli_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from click.testing import CliRunner
from pyfiguration import cli


def test_cli_module():
runner = CliRunner()
result = runner.invoke(
cli,
[
"config",
"./examples/basic/basic.py",
"--config",
"./examples/basic/config/defaults",
"./examples/basic/config/deployments/a.yaml",
],
)
assert result.exit_code == 0
assert result.output == ""
11 changes: 11 additions & 0 deletions tests/test_cli_module.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from click.testing import CliRunner
from pyfiguration import cli


def test_cli_module():
runner = CliRunner()
result = runner.invoke(cli, ["module", "./examples/basic/basic.py"])
assert result.exit_code == 0
assert result.output.startswith(
"The following options can be used in a configuration file for the module"
)

0 comments on commit afec1e1

Please sign in to comment.