moto/tests/test_opsworks/test_instances.py

31 lines
731 B
Python
Raw Normal View History

2016-04-15 19:44:38 +00:00
from __future__ import unicode_literals
import boto3
import sure # noqa
import re
from moto import mock_opsworks
@mock_opsworks
def test_create_instance_response():
client = boto3.client('opsworks')
stack_id = client.create_stack(
Name="test_stack_1",
Region="us-east-1",
ServiceRoleArn="service_arn",
DefaultInstanceProfileArn="profile_arn"
)['StackId']
layer_id = client.create_layer(
StackId=stack_id,
Type="custom",
Name="TestLayer",
Shortname="TestLayerShortName"
)['LayerId']
response = client.create_instance(
StackId=stack_id, LayerIds=[layer_id], InstanceType="t2.micro"
)
response.should.contain("InstanceId")