@@ -152,3 +152,35 @@ def test_missing_arn_handling(self, broken_metadata_service, fake_aws_environmen
152152 fake_aws_environment .caller_identity = {"UserId" : "test-user" }
153153 result = detect_platforms (timeout_seconds = None )
154154 assert "has_aws_identity" not in result
155+
156+ def test_azure_managed_identity_wrong_issuer (self , fake_azure_vm_metadata_service ):
157+ fake_azure_vm_metadata_service .iss = "https://fake-issuer.com"
158+ result = detect_platforms (timeout_seconds = None )
159+ assert "azure_managed_identity" not in result
160+
161+ def test_azure_function_missing_identity_endpoint (self , broken_metadata_service ):
162+ result = detect_platforms (timeout_seconds = None )
163+ assert "is_azure_function" not in result
164+
165+ def test_aws_ec2_empty_instance_document (
166+ self , broken_metadata_service , fake_aws_environment
167+ ):
168+ fake_aws_environment .instance_document = b""
169+ result = detect_platforms (timeout_seconds = None )
170+ assert "is_ec2_instance" not in result
171+
172+ def test_aws_lambda_empty_task_root (self , broken_metadata_service ):
173+ result = detect_platforms (timeout_seconds = None )
174+ assert "is_aws_lambda" not in result
175+
176+ def test_github_actions_missing_environment_variable (self , broken_metadata_service ):
177+ result = detect_platforms (timeout_seconds = None )
178+ assert "is_github_action" not in result
179+
180+ def test_gce_cloud_run_service_missing_k_service (self , broken_metadata_service ):
181+ result = detect_platforms (timeout_seconds = None )
182+ assert "is_gce_cloud_run_service" not in result
183+
184+ def test_gce_cloud_run_job_missing_cloud_run_job (self , broken_metadata_service ):
185+ result = detect_platforms (timeout_seconds = None )
186+ assert "is_gce_cloud_run_job" not in result
0 commit comments