-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
16 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,34 @@ | ||
""" | ||
Test for the "apio examples" command | ||
""" | ||
|
||
# -- apio examples entry point | ||
from apio.commands.examples import cli as cmd_examples | ||
|
||
|
||
def test_examples(clirunner, validate_cliresult, configenv): | ||
result = clirunner.invoke(cmd_examples) | ||
validate_cliresult(result) | ||
|
||
"""Test "apio examples" with different parameters""" | ||
|
||
def test_examples_list(clirunner, configenv): | ||
with clirunner.isolated_filesystem(): | ||
|
||
# -- Config the environment (conftest.configenv()) | ||
configenv() | ||
|
||
# -- Execute "apio examples" | ||
result = clirunner.invoke(cmd_examples) | ||
validate_cliresult(result) | ||
|
||
# -- Execute "apio examples --list" | ||
result = clirunner.invoke(cmd_examples, ['--list']) | ||
assert result.exit_code == 1 | ||
assert 'apio install examples' in result.output | ||
|
||
|
||
def test_examples_dir(clirunner, configenv): | ||
with clirunner.isolated_filesystem(): | ||
configenv() | ||
# -- Execute "apio examples --dir dir" | ||
result = clirunner.invoke(cmd_examples, ['--dir', 'dir']) | ||
assert result.exit_code == 1 | ||
assert 'apio install examples' in result.output | ||
|
||
|
||
def test_examples_files(clirunner, configenv): | ||
with clirunner.isolated_filesystem(): | ||
configenv() | ||
# -- Execute "apio examples --files file" | ||
result = clirunner.invoke(cmd_examples, ['--files', 'file']) | ||
assert result.exit_code == 1 | ||
assert 'apio install examples' in result.output |