From a02fb5c00a68cf81801da20c61f26853b6308c5c Mon Sep 17 00:00:00 2001 From: Obijuan Date: Sat, 24 Feb 2024 11:24:50 +0100 Subject: [PATCH] refactor test_config.py --- test/env_commands/test_config.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/test/env_commands/test_config.py b/test/env_commands/test_config.py index 37516242..d37d45dc 100644 --- a/test/env_commands/test_config.py +++ b/test/env_commands/test_config.py @@ -1,22 +1,27 @@ +""" + Test for the "apio config" command +""" + +# -- apio config entry point from apio.commands.config import cli as cmd_config def test_config(clirunner, validate_cliresult, configenv): + """Test "apio config" with different parameters""" + with clirunner.isolated_filesystem(): + + # -- Config the environment (conftest.configenv()) configenv() + + # -- Execute "apio config" result = clirunner.invoke(cmd_config) validate_cliresult(result) - -def test_config_list(clirunner, validate_cliresult, configenv): - with clirunner.isolated_filesystem(): - configenv() + # -- Execute "apio config --list" result = clirunner.invoke(cmd_config, ['--list']) validate_cliresult(result) - -def test_config_exe(clirunner, validate_cliresult, configenv): - with clirunner.isolated_filesystem(): - configenv() + # -- Execute "apio config --exe native" result = clirunner.invoke(cmd_config, ['--exe', 'native']) validate_cliresult(result)