moto/tests/test_ec2/test_server.py

22 lines
496 B
Python
Raw Normal View History

2013-03-05 13:14:43 +00:00
import re
2013-08-03 21:21:25 +00:00
import sure # noqa
2013-03-05 13:14:43 +00:00
import moto.server as server
'''
Test the different server responses
'''
def test_ec2_server_get():
2013-12-29 01:15:37 +00:00
backend = server.create_backend_app("ec2")
test_client = backend.test_client()
2013-03-05 13:14:43 +00:00
res = test_client.get('/?Action=RunInstances&ImageId=ami-60a54009')
groups = re.search("<instanceId>(.*)</instanceId>", res.data)
instance_id = groups.groups()[0]
res = test_client.get('/?Action=DescribeInstances')
res.data.should.contain(instance_id)