fix(categories): remove empty categories from metadata (#2401)

This commit is contained in:
Sergio Garcia
2023-05-24 10:44:51 +02:00
committed by GitHub
parent 71a789c0b4
commit c10b31e9d0
6 changed files with 171 additions and 9 deletions

View File

@@ -4,12 +4,14 @@ from importlib.machinery import FileFinder
from pkgutil import ModuleInfo
from boto3 import client, session
from fixtures.bulk_checks_metadata import test_bulk_checks_metadata
from mock import patch
from moto import mock_s3
from prowler.lib.check.check import (
exclude_checks_to_run,
exclude_services_to_run,
list_categories,
list_modules,
list_services,
parse_checks_from_file,
@@ -319,6 +321,17 @@ class Test_Check:
listed_services = list_services(provider)
assert listed_services == sorted(expected_services)
def test_list_categories(self):
expected_categories = {
"secrets",
"forensics-ready",
"encryption",
"internet-exposed",
"trustboundaries",
}
listed_categories = list_categories(test_bulk_checks_metadata)
assert listed_categories == expected_categories
@patch("prowler.lib.check.check.list_modules", new=mock_list_modules)
def test_recover_checks_from_provider(self):
provider = "azure"