Skip to content

Commit 8e79c1d

Browse files
added parameterized test for testing valid aws arn identities
1 parent 971a0bd commit 8e79c1d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

test/unit/test_detect_platforms.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,19 @@ def test_aws_lambda_detection(self, broken_metadata_service, fake_aws_environmen
3232
result = detect_platforms(timeout_seconds=None)
3333
assert "is_aws_lambda" in result
3434

35+
@pytest.mark.parametrize(
36+
"arn",
37+
[
38+
"arn:aws:iam::123456789012:user/John",
39+
"arn:aws:sts::123456789012:assumed-role/Accounting-Role/Jane",
40+
],
41+
ids=[
42+
"user",
43+
"assumed_role",
44+
],
45+
)
3546
def test_aws_identity_detection(
36-
self, broken_metadata_service, fake_aws_environment
47+
self, broken_metadata_service, fake_aws_environment, arn
3748
):
3849
result = detect_platforms(timeout_seconds=None)
3950
assert "has_aws_identity" in result

0 commit comments

Comments
 (0)