Fix test_suspend_processes
* Add `region_name` to the client to be consistent with other tests * Add `VPCZoneIdentifier` to the ASG creation (AZ or VPC is required) * Add myself as a contributor
This commit is contained in:
parent
bfeea00774
commit
baedbfa8ca
@ -50,3 +50,4 @@ Moto is written by Steve Pulec with contributions from:
|
||||
* [Jessie Nadler](https://github.com/nadlerjessie)
|
||||
* [Alex Morken](https://github.com/alexmorken)
|
||||
* [Clive Li](https://github.com/cliveli)
|
||||
* [Jim Shields](https://github.com/jimjshields)
|
||||
|
@ -1069,8 +1069,9 @@ def test_set_instance_health():
|
||||
instance1['HealthStatus'].should.equal('Unhealthy')
|
||||
|
||||
@mock_autoscaling
|
||||
def test_asg():
|
||||
client = boto3.client('autoscaling')
|
||||
def test_suspend_processes():
|
||||
mocked_networking = setup_networking()
|
||||
client = boto3.client('autoscaling', region_name='us-east-1')
|
||||
client.create_launch_configuration(
|
||||
LaunchConfigurationName='lc',
|
||||
)
|
||||
@ -1079,9 +1080,10 @@ def test_asg():
|
||||
AutoScalingGroupName='test-asg',
|
||||
MinSize=1,
|
||||
MaxSize=1,
|
||||
VPCZoneIdentifier=mocked_networking['subnet1'],
|
||||
)
|
||||
|
||||
# Testing something that calls the below...
|
||||
# When we suspend the 'Launch' process on the ASG client
|
||||
client.suspend_processes(
|
||||
AutoScalingGroupName='test-asg',
|
||||
ScalingProcesses=['Launch']
|
||||
@ -1090,6 +1092,8 @@ def test_asg():
|
||||
res = client.describe_auto_scaling_groups(
|
||||
AutoScalingGroupNames=['test-asg']
|
||||
)
|
||||
|
||||
# The 'Launch' process should, in fact, be suspended
|
||||
launch_suspended = False
|
||||
for proc in res['AutoScalingGroups'][0]['SuspendedProcesses']:
|
||||
if proc.get('ProcessName') == 'Launch':
|
||||
|
Loading…
Reference in New Issue
Block a user