| 
									
										
										
										
											2021-08-04 01:45:41 -04:00
										 |  |  | import uuid | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | from moto.wafv2.utils import make_arn_for_wacl | 
					
						
							| 
									
										
										
										
											2022-08-13 09:49:43 +00:00
										 |  |  | from moto.core import DEFAULT_ACCOUNT_ID as ACCOUNT_ID | 
					
						
							| 
									
										
										
										
											2021-08-04 01:45:41 -04: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) | 
					
						
							| 
									
										
										
										
											2022-11-17 21:41:08 -01:00
										 |  |  |     assert ( | 
					
						
							|  |  |  |         arn == f"arn:aws:wafv2:{region}:{ACCOUNT_ID}:regional/webacl/{name}/{uniqueID}" | 
					
						
							| 
									
										
										
										
											2021-08-04 01:45:41 -04:00
										 |  |  |     ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     scope = "CLOUDFRONT" | 
					
						
							| 
									
										
										
										
											2022-08-13 09:49:43 +00:00
										 |  |  |     arn = make_arn_for_wacl(name, ACCOUNT_ID, region, uniqueID, scope) | 
					
						
							| 
									
										
										
										
											2022-11-17 21:41:08 -01:00
										 |  |  |     assert arn == f"arn:aws:wafv2:{region}:{ACCOUNT_ID}:global/webacl/{name}/{uniqueID}" |