-
Notifications
You must be signed in to change notification settings - Fork 143
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
9 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,21 +1,28 @@ | ||
from apio.commands.install import cli as cmd_install | ||
""" | ||
Test for the "apio install" command | ||
""" | ||
|
||
# -- apio install entry point | ||
from apio.commands.install import cli as cmd_install | ||
|
||
def test_install(clirunner, validate_cliresult): | ||
result = clirunner.invoke(cmd_install) | ||
validate_cliresult(result) | ||
|
||
def test_install(clirunner, configenv, validate_cliresult): | ||
"""Test "apio install" with different parameters""" | ||
|
||
def test_install_list(clirunner, validate_cliresult, configenv): | ||
with clirunner.isolated_filesystem(): | ||
|
||
# -- Config the environment (conftest.configenv()) | ||
configenv() | ||
result = clirunner.invoke(cmd_install, ['--list']) | ||
|
||
# -- Execute "apio install" | ||
result = clirunner.invoke(cmd_install) | ||
validate_cliresult(result) | ||
|
||
# -- Execute "apio install --list" | ||
result = clirunner.invoke(cmd_install, ['--list']) | ||
validate_cliresult(result) | ||
|
||
def test_install_wrong_package(clirunner, configenv): | ||
with clirunner.isolated_filesystem(): | ||
configenv() | ||
# -- Execute "apio install missing_package" | ||
result = clirunner.invoke(cmd_install, ['missing_package']) | ||
assert result.exit_code == 1 | ||
assert 'Error: no such package' in result.output |