From 493a71138a3e194f32b4f7842508de63e1ce5bf8 Mon Sep 17 00:00:00 2001 From: Camilo Cota Date: Thu, 7 Nov 2024 16:50:43 +0100 Subject: [PATCH] test that openapi job is not added when no openapi config exists --- tests/scanners/zap/test_setup.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/scanners/zap/test_setup.py b/tests/scanners/zap/test_setup.py index 72eba6ea..e8076a7a 100644 --- a/tests/scanners/zap/test_setup.py +++ b/tests/scanners/zap/test_setup.py @@ -61,6 +61,14 @@ def test_setup_no_api_config(test_config): test_zap.setup() + # openapi job is not added when no openapi config exists + test_config.delete("scanners.zap.apiScan") + test_zap = ZapNone(config=test_config) + + test_zap.setup() + + for item in test_zap.automation_config["jobs"]: + assert item["type"] != "openapi" ## Testing Authentication methods ## ### Handling Authentication is different depending on the container.type so it'd be better to have test cases separately @@ -436,3 +444,4 @@ def test_setup_export_site_tree(test_config, pytestconfig): assert add_variable_script["parameters"]["name"] == run_variable_script["parameters"]["name"] assert add_variable_script["parameters"]["inline"] assert add_variable_script["parameters"]["engine"] == "ECMAScript : Graal.js" +