diff --git a/plugins/gcp/test/test_collector.py b/plugins/gcp/test/test_collector.py index 3dfb5e5c8..66c078d9e 100644 --- a/plugins/gcp/test/test_collector.py +++ b/plugins/gcp/test/test_collector.py @@ -90,6 +90,8 @@ def all_base_classes(cls: Type[Any]) -> Set[Type[Any]]: expected_declared_properties = ["kind", "_kind_display"] expected_props_in_hierarchy = ["_kind_service", "_metadata"] for rc in all_resources: + if not rc._model_export: + continue for prop in expected_declared_properties: assert prop in rc.__dict__, f"{rc.__name__} missing {prop}" with_bases = (all_base_classes(rc) | {rc}) - {GcpResource, BaseResource} diff --git a/plugins/gcp/test/test_scc.py b/plugins/gcp/test/test_scc.py index 009a1c86c..b5aba7583 100644 --- a/plugins/gcp/test/test_scc.py +++ b/plugins/gcp/test/test_scc.py @@ -7,13 +7,12 @@ from .random_client import roundtrip -class DefaultDict(dict): - # for random location name we use the default global location - def __init__(self, default_value: Any, *args, **kwargs): +class DefaultDict(dict): # type: ignore + def __init__(self, default_value: Any, *args: Any, **kwargs: Any): super().__init__(*args, **kwargs) self.default_value = default_value - def get(self, key, default=None): + def get(self, key: str, default: Any = None): if key in self: return super().get(key, default) return self.default_value @@ -21,6 +20,7 @@ def get(self, key, default=None): def test_gcp_scc_findings(random_builder: GraphBuilder) -> None: firewall = roundtrip(GcpFirewall, random_builder) + # for random location name we will use the default global location random_builder.region_by_name = DefaultDict(random_builder.fallback_global_region) GcpSccFinding.collect_resources(random_builder)