Best Python code snippet using localstack_python
provider.py
Source:provider.py
...317 return "arn:aws-us-gov:iam::aws:policy{0}{1}".format(self.path, self.name)318def apply_patches():319 # support service linked roles320 @property321 def moto_role_arn(self):322 return getattr(self, "service_linked_role_arn", None) or moto_role_og_arn_prop.__get__(self)323 moto_role_og_arn_prop = MotoRole.arn324 MotoRole.arn = moto_role_arn325 # Add missing managed polices326 aws_managed_policies.extend(327 [AWSManagedPolicy.from_data(k, v) for k, v in ADDITIONAL_MANAGED_POLICIES.items()]328 )329 if "Principal" not in VALID_STATEMENT_ELEMENTS:330 VALID_STATEMENT_ELEMENTS.append("Principal")331 @patch(IAMPolicyDocumentValidator._validate_resource_syntax, pass_target=False)332 def _validate_resource_syntax(statement, *args, **kwargs):333 # Note: Serverless generates policies without "Resource" section (only "Effect"/"Principal"/"Action"),334 # which causes several policy validators in moto to fail335 if statement.get("Resource") in [None, [None]]:...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!