diff --git a/tests/config/schema/exclusions_test.py b/tests/config/schema/exclusions_test.py index 1678ff1958..ee112a47d2 100644 --- a/tests/config/schema/exclusions_test.py +++ b/tests/config/schema/exclusions_test.py @@ -15,6 +15,7 @@ from prowler.config.scan_config_schema import SCAN_CONFIG_SCHEMA from prowler.config.schema.aws import AWSProviderConfig from prowler.config.schema.registry import SCHEMAS from prowler.config.schema.validator import validate_provider_config +from prowler.providers.common.provider import Provider EXCLUSION_FIELDS = ("excluded_checks", "excluded_services") @@ -23,7 +24,9 @@ class Test_JSON_Schema_Exposes_Exclusion_Fields: # The aggregated schema is app-facing and only carries app providers # (``sdk_only = False``); iterate exactly what it exposes so SDK/CLI-only # providers (still in ``SCHEMAS`` for CLI validation) are not asserted here. - @pytest.mark.parametrize("provider", sorted(SCAN_CONFIG_SCHEMA["properties"])) + @pytest.mark.parametrize( + "provider", sorted(set(Provider.get_app_providers()) & set(SCHEMAS)) + ) @pytest.mark.parametrize("field", EXCLUSION_FIELDS) def test_field_shape(self, provider, field): field_schema = SCAN_CONFIG_SCHEMA["properties"][provider]["properties"][field] diff --git a/tests/config/schema/scan_config_schema_test.py b/tests/config/schema/scan_config_schema_test.py index 8b9e7938fa..399f9ad90e 100644 --- a/tests/config/schema/scan_config_schema_test.py +++ b/tests/config/schema/scan_config_schema_test.py @@ -411,7 +411,8 @@ class Test_Aggregated_Schema_Is_App_Facing: def test_schema_contains_only_app_providers(self): app_providers = set(Provider.get_app_providers()) - assert set(SCAN_CONFIG_SCHEMA["properties"]).issubset(app_providers) + registered_app_providers = app_providers & set(SCHEMAS) + assert set(SCAN_CONFIG_SCHEMA["properties"]) == registered_app_providers def test_app_provider_with_registered_schema_is_present(self): assert "aws" in SCAN_CONFIG_SCHEMA["properties"]