Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.

Commit 412623c

Browse files
committed
add unit test
1 parent c2e7b05 commit 412623c

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

tests/unit/utils/aws/test_arns.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from localstack.utils.aws import arns
2+
3+
4+
def test_arn_creation_with_colon_names():
5+
region_name = "us-east-1"
6+
account_id = "123456789012"
7+
name = "noColons"
8+
name_colon = "col:on"
9+
pattern = "arn:%s:<service>:%s:%s:thing/%s"
10+
11+
assert (
12+
arns._resource_arn(name, pattern, account_id, region_name)
13+
== f"arn:aws:<service>:{region_name}:{account_id}:thing/{name}"
14+
)
15+
assert arns._resource_arn(name_colon, pattern, account_id, region_name) == name_colon
16+
assert (
17+
arns._resource_arn(name_colon, pattern, account_id, region_name, True)
18+
== f"arn:aws:<service>:{region_name:}:{account_id}:thing/{name_colon}"
19+
)

0 commit comments

Comments
 (0)