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)
|
* [Jessie Nadler](https://github.com/nadlerjessie)
|
||||||
* [Alex Morken](https://github.com/alexmorken)
|
* [Alex Morken](https://github.com/alexmorken)
|
||||||
* [Clive Li](https://github.com/cliveli)
|
* [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')
|
instance1['HealthStatus'].should.equal('Unhealthy')
|
||||||
|
|
||||||
@mock_autoscaling
|
@mock_autoscaling
|
||||||
def test_asg():
|
def test_suspend_processes():
|
||||||
client = boto3.client('autoscaling')
|
mocked_networking = setup_networking()
|
||||||
|
client = boto3.client('autoscaling', region_name='us-east-1')
|
||||||
client.create_launch_configuration(
|
client.create_launch_configuration(
|
||||||
LaunchConfigurationName='lc',
|
LaunchConfigurationName='lc',
|
||||||
)
|
)
|
||||||
@ -1079,9 +1080,10 @@ def test_asg():
|
|||||||
AutoScalingGroupName='test-asg',
|
AutoScalingGroupName='test-asg',
|
||||||
MinSize=1,
|
MinSize=1,
|
||||||
MaxSize=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(
|
client.suspend_processes(
|
||||||
AutoScalingGroupName='test-asg',
|
AutoScalingGroupName='test-asg',
|
||||||
ScalingProcesses=['Launch']
|
ScalingProcesses=['Launch']
|
||||||
@ -1090,6 +1092,8 @@ def test_asg():
|
|||||||
res = client.describe_auto_scaling_groups(
|
res = client.describe_auto_scaling_groups(
|
||||||
AutoScalingGroupNames=['test-asg']
|
AutoScalingGroupNames=['test-asg']
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# The 'Launch' process should, in fact, be suspended
|
||||||
launch_suspended = False
|
launch_suspended = False
|
||||||
for proc in res['AutoScalingGroups'][0]['SuspendedProcesses']:
|
for proc in res['AutoScalingGroups'][0]['SuspendedProcesses']:
|
||||||
if proc.get('ProcessName') == 'Launch':
|
if proc.get('ProcessName') == 'Launch':
|
||||||
|
Loading…
Reference in New Issue
Block a user