-
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
20 additions
and
16 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,35 +1,39 @@ | ||
""" | ||
Test for the "apio system" command | ||
""" | ||
|
||
# -- apio system entry point | ||
from apio.commands.system import cli as cmd_system | ||
|
||
|
||
def test_system(clirunner, validate_cliresult, configenv): | ||
result = clirunner.invoke(cmd_system) | ||
validate_cliresult(result) | ||
|
||
"""Test "apio system" with different parameters""" | ||
|
||
def test_system_lsftdi(clirunner, configenv): | ||
with clirunner.isolated_filesystem(): | ||
|
||
# -- Config the environment (conftest.configenv()) | ||
configenv() | ||
|
||
# -- Execute "apio system" | ||
result = clirunner.invoke(cmd_system) | ||
validate_cliresult(result) | ||
|
||
# -- Execute "apio system --lsftdi" | ||
result = clirunner.invoke(cmd_system, ['--lsftdi']) | ||
assert result.exit_code == 1 | ||
assert 'apio install oss-cad-suite' in result.output | ||
|
||
|
||
def test_system_lsusb(clirunner, configenv): | ||
with clirunner.isolated_filesystem(): | ||
configenv() | ||
# -- Execute "apio system --lsusb" | ||
result = clirunner.invoke(cmd_system, ['--lsusb']) | ||
assert result.exit_code == 1 | ||
assert 'apio install oss-cad-suite' in result.output | ||
|
||
|
||
def test_system_lsserial(clirunner, configenv): | ||
with clirunner.isolated_filesystem(): | ||
configenv() | ||
# -- Execute "apio system --lsserial" | ||
clirunner.invoke(cmd_system, ['--lsserial']) | ||
assert result.exit_code == 1 | ||
assert 'apio install oss-cad-suite' in result.output | ||
|
||
|
||
def test_system_info(clirunner, configenv): | ||
with clirunner.isolated_filesystem(): | ||
configenv() | ||
# -- Execute "apio system --info" | ||
result = clirunner.invoke(cmd_system, ['--info']) | ||
assert result.exit_code == 0 | ||
assert "Platform:" in result.output |