moto/tests/test_wafv2/test_utils.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
614 B
Python
Raw Permalink Normal View History

2021-08-04 05:45:41 +00:00
import uuid
2022-08-13 09:49:43 +00:00
from moto.core import DEFAULT_ACCOUNT_ID as ACCOUNT_ID
from moto.wafv2.utils import make_arn_for_wacl
2021-08-04 05:45:41 +00:00
def test_make_arn_for_wacl():
uniqueID = str(uuid.uuid4())
region = "us-east-1"
name = "testName"
scope = "REGIONAL"
2022-08-13 09:49:43 +00:00
arn = make_arn_for_wacl(name, ACCOUNT_ID, region, uniqueID, scope)
assert (
arn == f"arn:aws:wafv2:{region}:{ACCOUNT_ID}:regional/webacl/{name}/{uniqueID}"
2021-08-04 05:45:41 +00:00
)
scope = "CLOUDFRONT"
2022-08-13 09:49:43 +00:00
arn = make_arn_for_wacl(name, ACCOUNT_ID, region, uniqueID, scope)
assert arn == f"arn:aws:wafv2:{region}:{ACCOUNT_ID}:global/webacl/{name}/{uniqueID}"