Python3 fixes for cloudformation server.
This commit is contained in:
parent
84c9dd03d2
commit
71d2e1d7de
@ -1,7 +1,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import urllib
|
from six.moves.urllib.parse import urlencode
|
||||||
import re
|
import re
|
||||||
import sure # noqa
|
import sure # noqa
|
||||||
|
|
||||||
@ -11,6 +11,7 @@ import moto.server as server
|
|||||||
Test the different server responses
|
Test the different server responses
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
def test_cloudformation_server_get():
|
def test_cloudformation_server_get():
|
||||||
backend = server.create_backend_app("cloudformation")
|
backend = server.create_backend_app("cloudformation")
|
||||||
stack_name = 'test stack'
|
stack_name = 'test stack'
|
||||||
@ -20,14 +21,15 @@ def test_cloudformation_server_get():
|
|||||||
}
|
}
|
||||||
res = test_client.get(
|
res = test_client.get(
|
||||||
'/?{0}'.format(
|
'/?{0}'.format(
|
||||||
urllib.urlencode({
|
urlencode({
|
||||||
"Action": "CreateStack",
|
"Action": "CreateStack",
|
||||||
"StackName": stack_name,
|
"StackName": stack_name,
|
||||||
"TemplateBody": json.dumps(template_body)
|
"TemplateBody": json.dumps(template_body)
|
||||||
})),
|
})
|
||||||
|
),
|
||||||
headers={"Host": "cloudformation.us-east-1.amazonaws.com"}
|
headers={"Host": "cloudformation.us-east-1.amazonaws.com"}
|
||||||
)
|
)
|
||||||
stack_id = json.loads(res.data)["CreateStackResponse"]["CreateStackResult"]["StackId"]
|
stack_id = json.loads(res.data.decode("utf-8"))["CreateStackResponse"]["CreateStackResult"]["StackId"]
|
||||||
|
|
||||||
res = test_client.get(
|
res = test_client.get(
|
||||||
'/?Action=ListStacks',
|
'/?Action=ListStacks',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user