Adding server mode
This commit is contained in:
parent
c6f5afff75
commit
a728b2581a
31 changed files with 489 additions and 66 deletions
20
tests/test_ec2/test_server.py
Normal file
20
tests/test_ec2/test_server.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import re
|
||||
import sure # flake8: noqa
|
||||
|
||||
import moto.server as server
|
||||
|
||||
'''
|
||||
Test the different server responses
|
||||
'''
|
||||
server.configure_urls("ec2")
|
||||
|
||||
|
||||
def test_ec2_server_get():
|
||||
test_client = server.app.test_client()
|
||||
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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue