diff --git a/test/env_commands/test_system.py b/test/env_commands/test_system.py index 6dccde9e..4c246b38 100644 --- a/test/env_commands/test_system.py +++ b/test/env_commands/test_system.py @@ -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