From fd3abc6aecdf50fbdf3a91ca29a9caa3b06b96bd Mon Sep 17 00:00:00 2001 From: Georg Pfuetzenreuter Date: Sun, 21 May 2023 10:57:51 +0200 Subject: [PATCH] Rename test scripts Signed-off-by: Georg Pfuetzenreuter --- tests/{test_cli.py => 01_test_cli.py} | 21 +++++++++++++++++++ tests/{test_vagrant.py => 02_test_vagrant.py} | 0 2 files changed, 21 insertions(+) rename tests/{test_cli.py => 01_test_cli.py} (87%) rename tests/{test_vagrant.py => 02_test_vagrant.py} (100%) diff --git a/tests/test_cli.py b/tests/01_test_cli.py similarity index 87% rename from tests/test_cli.py rename to tests/01_test_cli.py index 32be7ea..188da1b 100644 --- a/tests/test_cli.py +++ b/tests/01_test_cli.py @@ -121,6 +121,27 @@ def test_envfile(script_runner, script, config, suite, masters, minions): assert os.path.isfile(envfile) is False +@pytest.mark.parametrize('config', ['complete'], indirect=True) +def test_test_undeclared(script_runner, script, config): + result = script_runner.run(script, '--config', config, '--suite', 'one_minion', '--test') + assert not result.success + assert result.stderr.endswith('Tests requested but not declared in suite configuration\n') + + +@pytest.mark.parametrize('config', ['complete'], indirect=True) +def test_test_undefined(script_runner, script, config): + result = script_runner.run(script, '--config', config, '--suite', 'one_minion_bogus_test', '--test') + assert not result.success + assert result.stderr.endswith('Specified test is not defined\n') + + +@pytest.mark.parametrize('config', ['complete'], indirect=True) +def test_test_incomplete(script_runner, script, config): + result = script_runner.run(script, '--config', config, '--suite', 'one_minion_bogus_test_2', '--test') + assert not result.success + assert result.stderr.endswith('Incomplete test configuration\n') + + @pytest.mark.parametrize('config', ['complete'], indirect=True) @pytest.mark.parametrize('suite', [ 'one_minion', diff --git a/tests/test_vagrant.py b/tests/02_test_vagrant.py similarity index 100% rename from tests/test_vagrant.py rename to tests/02_test_vagrant.py