Run black on moto & test directories.
This commit is contained in:
parent
c820395dbf
commit
96e5b1993d
507 changed files with 52541 additions and 47814 deletions
|
|
@ -11,19 +11,19 @@ from moto import mock_athena
|
|||
|
||||
@mock_athena
|
||||
def test_create_work_group():
|
||||
client = boto3.client('athena', region_name='us-east-1')
|
||||
client = boto3.client("athena", region_name="us-east-1")
|
||||
|
||||
response = client.create_work_group(
|
||||
Name='athena_workgroup',
|
||||
Description='Test work group',
|
||||
Name="athena_workgroup",
|
||||
Description="Test work group",
|
||||
Configuration={
|
||||
'ResultConfiguration': {
|
||||
'OutputLocation': 's3://bucket-name/prefix/',
|
||||
'EncryptionConfiguration': {
|
||||
'EncryptionOption': 'SSE_KMS',
|
||||
'KmsKey': 'aws:arn:kms:1233456789:us-east-1:key/number-1',
|
||||
"ResultConfiguration": {
|
||||
"OutputLocation": "s3://bucket-name/prefix/",
|
||||
"EncryptionConfiguration": {
|
||||
"EncryptionOption": "SSE_KMS",
|
||||
"KmsKey": "aws:arn:kms:1233456789:us-east-1:key/number-1",
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
Tags=[],
|
||||
)
|
||||
|
|
@ -31,29 +31,29 @@ def test_create_work_group():
|
|||
try:
|
||||
# The second time should throw an error
|
||||
response = client.create_work_group(
|
||||
Name='athena_workgroup',
|
||||
Description='duplicate',
|
||||
Name="athena_workgroup",
|
||||
Description="duplicate",
|
||||
Configuration={
|
||||
'ResultConfiguration': {
|
||||
'OutputLocation': 's3://bucket-name/prefix/',
|
||||
'EncryptionConfiguration': {
|
||||
'EncryptionOption': 'SSE_KMS',
|
||||
'KmsKey': 'aws:arn:kms:1233456789:us-east-1:key/number-1',
|
||||
"ResultConfiguration": {
|
||||
"OutputLocation": "s3://bucket-name/prefix/",
|
||||
"EncryptionConfiguration": {
|
||||
"EncryptionOption": "SSE_KMS",
|
||||
"KmsKey": "aws:arn:kms:1233456789:us-east-1:key/number-1",
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
)
|
||||
except ClientError as err:
|
||||
err.response['Error']['Code'].should.equal('InvalidRequestException')
|
||||
err.response['Error']['Message'].should.equal('WorkGroup already exists')
|
||||
err.response["Error"]["Code"].should.equal("InvalidRequestException")
|
||||
err.response["Error"]["Message"].should.equal("WorkGroup already exists")
|
||||
else:
|
||||
raise RuntimeError('Should have raised ResourceNotFoundException')
|
||||
raise RuntimeError("Should have raised ResourceNotFoundException")
|
||||
|
||||
# Then test the work group appears in the work group list
|
||||
response = client.list_work_groups()
|
||||
|
||||
response['WorkGroups'].should.have.length_of(1)
|
||||
work_group = response['WorkGroups'][0]
|
||||
work_group['Name'].should.equal('athena_workgroup')
|
||||
work_group['Description'].should.equal('Test work group')
|
||||
work_group['State'].should.equal('ENABLED')
|
||||
response["WorkGroups"].should.have.length_of(1)
|
||||
work_group = response["WorkGroups"][0]
|
||||
work_group["Name"].should.equal("athena_workgroup")
|
||||
work_group["Description"].should.equal("Test work group")
|
||||
work_group["State"].should.equal("ENABLED")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue