@@ -218,7 +218,8 @@ def test_get_security_health_analytics_custom_module():
218218
219219 assert response is not None , "Failed to retrieve the custom module."
220220 assert response .display_name .startswith (PREFIX )
221- assert response .enablement_state == securitycentermanagement_v1 .SecurityHealthAnalyticsCustomModule .EnablementState .ENABLED
221+ response_org_id = response .name .split ("/" )[1 ] # Extract organization ID from the name field
222+ assert response_org_id == ORGANIZATION_ID , f"Organization ID mismatch: Expected { ORGANIZATION_ID } , got { response_org_id } ."
222223
223224
224225@backoff .on_exception (
@@ -255,6 +256,7 @@ def test_list_security_health_analytics_custom_module():
255256 backoff .expo , (InternalServerError , ServiceUnavailable , NotFound ), max_tries = 3
256257)
257258def test_update_security_health_analytics_custom_module ():
259+
258260 parent = f"organizations/{ ORGANIZATION_ID } /locations/{ LOCATION } "
259261 response = security_health_analytics_custom_modules .create_security_health_analytics_custom_module (parent )
260262 module_id = extract_custom_module_id (response .name )
@@ -283,7 +285,8 @@ def test_get_effective_security_health_analytics_custom_module():
283285 assert response is not None , "Failed to retrieve the custom module."
284286 # Verify that the custom module was created
285287 assert response .display_name .startswith (PREFIX )
286- assert response .enablement_state == securitycentermanagement_v1 .EffectiveSecurityHealthAnalyticsCustomModule .EnablementState .ENABLED
288+ response_org_id = response .name .split ("/" )[1 ] # Extract organization ID from the name field
289+ assert response_org_id == ORGANIZATION_ID , f"Organization ID mismatch: Expected { ORGANIZATION_ID } , got { response_org_id } ."
287290
288291
289292@backoff .on_exception (
0 commit comments