Best Python code snippet using localstack_python
test_kms.py
Source:test_kms.py
...17 response = kms_client.describe_key(KeyId=key_id)["KeyMetadata"]18 assert response["KeyId"] == key_id19 assert ":%s:" % config.DEFAULT_REGION in response["Arn"]20 assert ":%s:" % TEST_AWS_ACCOUNT_ID in response["Arn"]21 def test_create_grant_with_invalid_key(self, kms_client):22 with pytest.raises(botocore.exceptions.ClientError):23 kms_client.create_grant(24 KeyId="invalid",25 GranteePrincipal="arn:aws:iam::000000000000:role/test",26 Operations=["Decrypt", "Encrypt"],27 )28 def test_list_grants_with_invalid_key(self, kms_client):29 with pytest.raises(botocore.exceptions.ClientError):30 kms_client.list_grants(31 KeyId="invalid",32 )33 def test_create_grant_with_valid_key(self, kms_client, kms_key):34 key_id = kms_key["KeyMetadata"]["KeyId"]35 grants_before = kms_client.list_grants(KeyId=key_id)["Grants"]...
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!!