Run black on moto & test directories.
This commit is contained in:
parent
c820395dbf
commit
96e5b1993d
507 changed files with 52541 additions and 47814 deletions
|
|
@ -6,9 +6,9 @@ import requests
|
|||
from moto import mock_ec2, settings
|
||||
|
||||
if settings.TEST_SERVER_MODE:
|
||||
BASE_URL = 'http://localhost:5000'
|
||||
BASE_URL = "http://localhost:5000"
|
||||
else:
|
||||
BASE_URL = 'http://169.254.169.254'
|
||||
BASE_URL = "http://169.254.169.254"
|
||||
|
||||
|
||||
@mock_ec2
|
||||
|
|
@ -21,26 +21,28 @@ def test_latest_meta_data():
|
|||
def test_meta_data_iam():
|
||||
res = requests.get("{0}/latest/meta-data/iam".format(BASE_URL))
|
||||
json_response = res.json()
|
||||
default_role = json_response['security-credentials']['default-role']
|
||||
default_role.should.contain('AccessKeyId')
|
||||
default_role.should.contain('SecretAccessKey')
|
||||
default_role.should.contain('Token')
|
||||
default_role.should.contain('Expiration')
|
||||
default_role = json_response["security-credentials"]["default-role"]
|
||||
default_role.should.contain("AccessKeyId")
|
||||
default_role.should.contain("SecretAccessKey")
|
||||
default_role.should.contain("Token")
|
||||
default_role.should.contain("Expiration")
|
||||
|
||||
|
||||
@mock_ec2
|
||||
def test_meta_data_security_credentials():
|
||||
res = requests.get(
|
||||
"{0}/latest/meta-data/iam/security-credentials/".format(BASE_URL))
|
||||
"{0}/latest/meta-data/iam/security-credentials/".format(BASE_URL)
|
||||
)
|
||||
res.content.should.equal(b"default-role")
|
||||
|
||||
|
||||
@mock_ec2
|
||||
def test_meta_data_default_role():
|
||||
res = requests.get(
|
||||
"{0}/latest/meta-data/iam/security-credentials/default-role".format(BASE_URL))
|
||||
"{0}/latest/meta-data/iam/security-credentials/default-role".format(BASE_URL)
|
||||
)
|
||||
json_response = res.json()
|
||||
json_response.should.contain('AccessKeyId')
|
||||
json_response.should.contain('SecretAccessKey')
|
||||
json_response.should.contain('Token')
|
||||
json_response.should.contain('Expiration')
|
||||
json_response.should.contain("AccessKeyId")
|
||||
json_response.should.contain("SecretAccessKey")
|
||||
json_response.should.contain("Token")
|
||||
json_response.should.contain("Expiration")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue