Add sub-minimal mocking of elasticbeanstalk:create_application()
This commit is contained in:
parent
c95d472bf5
commit
336f50349a
7 changed files with 181 additions and 5 deletions
|
|
@ -1,15 +1,39 @@
|
|||
import boto3
|
||||
import sure # noqa
|
||||
from botocore.exceptions import ClientError
|
||||
|
||||
from moto import mock_eb
|
||||
|
||||
|
||||
@mock_eb
|
||||
def test_application():
|
||||
def test_create_application():
|
||||
# Create Elastic Beanstalk Application
|
||||
eb_client = boto3.client('elasticbeanstalk', region_name='us-east-1')
|
||||
conn = boto3.client('elasticbeanstalk', region_name='us-east-1')
|
||||
app = conn.create_application(
|
||||
ApplicationName="myapp",
|
||||
)
|
||||
app['Application']['ApplicationName'].should.equal("myapp")
|
||||
|
||||
eb_client.create_application(
|
||||
|
||||
@mock_eb
|
||||
def test_create_application_dup():
|
||||
conn = boto3.client('elasticbeanstalk', region_name='us-east-1')
|
||||
conn.create_application(
|
||||
ApplicationName="myapp",
|
||||
)
|
||||
conn.create_application.when.called_with(
|
||||
ApplicationName="myapp",
|
||||
).should.throw(ClientError)
|
||||
|
||||
|
||||
@mock_eb
|
||||
def test_describe_applications():
|
||||
# Create Elastic Beanstalk Application
|
||||
conn = boto3.client('elasticbeanstalk', region_name='us-east-1')
|
||||
conn.create_application(
|
||||
ApplicationName="myapp",
|
||||
)
|
||||
|
||||
eb_apps = eb_client.describe_applications()
|
||||
eb_apps['Applications'][0]['ApplicationName'].should.equal("myapp")
|
||||
apps = conn.describe_applications()
|
||||
len(apps['Applications']).should.equal(1)
|
||||
apps['Applications'][0]['ApplicationName'].should.equal('myapp')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue