Testing new version of decorator.

This commit is contained in:
Steve Pulec 2017-02-15 22:35:45 -05:00
commit fde721bed7
123 changed files with 2740 additions and 1114 deletions

View file

@ -8,12 +8,12 @@ from boto.ec2.autoscale import Tag
import boto.ec2.elb
import sure # noqa
from moto import mock_autoscaling, mock_ec2, mock_elb
from moto import mock_autoscaling, mock_ec2_deprecated, mock_elb_deprecated, mock_autoscaling_deprecated
from tests.helpers import requires_boto_gte
@mock_autoscaling
@mock_elb
@mock_autoscaling_deprecated
@mock_elb_deprecated
def test_create_autoscaling_group():
elb_conn = boto.ec2.elb.connect_to_region('us-east-1')
elb_conn.create_load_balancer('test_lb', zones=[], listeners=[(80, 8080, 'http')])
@ -73,7 +73,7 @@ def test_create_autoscaling_group():
tag.propagate_at_launch.should.equal(True)
@mock_autoscaling
@mock_autoscaling_deprecated
def test_create_autoscaling_groups_defaults():
""" Test with the minimum inputs and check that all of the proper defaults
are assigned for the other attributes """
@ -112,7 +112,7 @@ def test_create_autoscaling_groups_defaults():
list(group.tags).should.equal([])
@mock_autoscaling
@mock_autoscaling_deprecated
def test_autoscaling_group_describe_filter():
conn = boto.connect_autoscale()
config = LaunchConfiguration(
@ -138,7 +138,7 @@ def test_autoscaling_group_describe_filter():
conn.get_all_groups().should.have.length_of(3)
@mock_autoscaling
@mock_autoscaling_deprecated
def test_autoscaling_update():
conn = boto.connect_autoscale()
config = LaunchConfiguration(
@ -169,7 +169,7 @@ def test_autoscaling_update():
group.vpc_zone_identifier.should.equal('subnet-5678efgh')
@mock_autoscaling
@mock_autoscaling_deprecated
def test_autoscaling_tags_update():
conn = boto.connect_autoscale()
config = LaunchConfiguration(
@ -211,7 +211,7 @@ def test_autoscaling_tags_update():
group.tags.should.have.length_of(2)
@mock_autoscaling
@mock_autoscaling_deprecated
def test_autoscaling_group_delete():
conn = boto.connect_autoscale()
config = LaunchConfiguration(
@ -235,8 +235,8 @@ def test_autoscaling_group_delete():
conn.get_all_groups().should.have.length_of(0)
@mock_ec2
@mock_autoscaling
@mock_ec2_deprecated
@mock_autoscaling_deprecated
def test_autoscaling_group_describe_instances():
conn = boto.connect_autoscale()
config = LaunchConfiguration(
@ -269,7 +269,7 @@ def test_autoscaling_group_describe_instances():
@requires_boto_gte("2.8")
@mock_autoscaling
@mock_autoscaling_deprecated
def test_set_desired_capacity_up():
conn = boto.connect_autoscale()
config = LaunchConfiguration(
@ -304,7 +304,7 @@ def test_set_desired_capacity_up():
@requires_boto_gte("2.8")
@mock_autoscaling
@mock_autoscaling_deprecated
def test_set_desired_capacity_down():
conn = boto.connect_autoscale()
config = LaunchConfiguration(
@ -339,7 +339,7 @@ def test_set_desired_capacity_down():
@requires_boto_gte("2.8")
@mock_autoscaling
@mock_autoscaling_deprecated
def test_set_desired_capacity_the_same():
conn = boto.connect_autoscale()
config = LaunchConfiguration(
@ -372,8 +372,8 @@ def test_set_desired_capacity_the_same():
instances = list(conn.get_all_autoscaling_instances())
instances.should.have.length_of(2)
@mock_autoscaling
@mock_elb
@mock_autoscaling_deprecated
@mock_elb_deprecated
def test_autoscaling_group_with_elb():
elb_conn = boto.connect_elb()
zones = ['us-east-1a', 'us-east-1b']

View file

@ -5,11 +5,11 @@ from boto.ec2.blockdevicemapping import BlockDeviceType, BlockDeviceMapping
import sure # noqa
from moto import mock_autoscaling
from moto import mock_autoscaling_deprecated
from tests.helpers import requires_boto_gte
@mock_autoscaling
@mock_autoscaling_deprecated
def test_create_launch_configuration():
conn = boto.connect_autoscale()
config = LaunchConfiguration(
@ -38,7 +38,7 @@ def test_create_launch_configuration():
@requires_boto_gte("2.27.0")
@mock_autoscaling
@mock_autoscaling_deprecated
def test_create_launch_configuration_with_block_device_mappings():
block_device_mapping = BlockDeviceMapping()
@ -101,7 +101,7 @@ def test_create_launch_configuration_with_block_device_mappings():
@requires_boto_gte("2.12")
@mock_autoscaling
@mock_autoscaling_deprecated
def test_create_launch_configuration_for_2_12():
conn = boto.connect_autoscale()
config = LaunchConfiguration(
@ -116,7 +116,7 @@ def test_create_launch_configuration_for_2_12():
@requires_boto_gte("2.25.0")
@mock_autoscaling
@mock_autoscaling_deprecated
def test_create_launch_configuration_using_ip_association():
conn = boto.connect_autoscale()
config = LaunchConfiguration(
@ -131,7 +131,7 @@ def test_create_launch_configuration_using_ip_association():
@requires_boto_gte("2.25.0")
@mock_autoscaling
@mock_autoscaling_deprecated
def test_create_launch_configuration_using_ip_association_should_default_to_false():
conn = boto.connect_autoscale()
config = LaunchConfiguration(
@ -144,7 +144,7 @@ def test_create_launch_configuration_using_ip_association_should_default_to_fals
launch_config.associate_public_ip_address.should.equal(False)
@mock_autoscaling
@mock_autoscaling_deprecated
def test_create_launch_configuration_defaults():
""" Test with the minimum inputs and check that all of the proper defaults
are assigned for the other attributes """
@ -171,7 +171,7 @@ def test_create_launch_configuration_defaults():
@requires_boto_gte("2.12")
@mock_autoscaling
@mock_autoscaling_deprecated
def test_create_launch_configuration_defaults_for_2_12():
conn = boto.connect_autoscale()
config = LaunchConfiguration(
@ -184,7 +184,7 @@ def test_create_launch_configuration_defaults_for_2_12():
launch_config.ebs_optimized.should.equal(False)
@mock_autoscaling
@mock_autoscaling_deprecated
def test_launch_configuration_describe_filter():
conn = boto.connect_autoscale()
config = LaunchConfiguration(
@ -202,7 +202,7 @@ def test_launch_configuration_describe_filter():
conn.get_all_launch_configurations().should.have.length_of(3)
@mock_autoscaling
@mock_autoscaling_deprecated
def test_launch_configuration_delete():
conn = boto.connect_autoscale()
config = LaunchConfiguration(

View file

@ -5,7 +5,7 @@ from boto.ec2.autoscale.group import AutoScalingGroup
from boto.ec2.autoscale.policy import ScalingPolicy
import sure # noqa
from moto import mock_autoscaling
from moto import mock_autoscaling_deprecated
def setup_autoscale_group():
@ -27,7 +27,7 @@ def setup_autoscale_group():
return group
@mock_autoscaling
@mock_autoscaling_deprecated
def test_create_policy():
setup_autoscale_group()
conn = boto.connect_autoscale()
@ -48,7 +48,7 @@ def test_create_policy():
policy.cooldown.should.equal(60)
@mock_autoscaling
@mock_autoscaling_deprecated
def test_create_policy_default_values():
setup_autoscale_group()
conn = boto.connect_autoscale()
@ -67,7 +67,7 @@ def test_create_policy_default_values():
policy.cooldown.should.equal(300)
@mock_autoscaling
@mock_autoscaling_deprecated
def test_update_policy():
setup_autoscale_group()
conn = boto.connect_autoscale()
@ -94,7 +94,7 @@ def test_update_policy():
policy.scaling_adjustment.should.equal(2)
@mock_autoscaling
@mock_autoscaling_deprecated
def test_delete_policy():
setup_autoscale_group()
conn = boto.connect_autoscale()
@ -112,7 +112,7 @@ def test_delete_policy():
conn.get_all_policies().should.have.length_of(0)
@mock_autoscaling
@mock_autoscaling_deprecated
def test_execute_policy_exact_capacity():
setup_autoscale_group()
conn = boto.connect_autoscale()
@ -130,7 +130,7 @@ def test_execute_policy_exact_capacity():
instances.should.have.length_of(3)
@mock_autoscaling
@mock_autoscaling_deprecated
def test_execute_policy_positive_change_in_capacity():
setup_autoscale_group()
conn = boto.connect_autoscale()
@ -148,7 +148,7 @@ def test_execute_policy_positive_change_in_capacity():
instances.should.have.length_of(5)
@mock_autoscaling
@mock_autoscaling_deprecated
def test_execute_policy_percent_change_in_capacity():
setup_autoscale_group()
conn = boto.connect_autoscale()
@ -166,7 +166,7 @@ def test_execute_policy_percent_change_in_capacity():
instances.should.have.length_of(3)
@mock_autoscaling
@mock_autoscaling_deprecated
def test_execute_policy_small_percent_change_in_capacity():
""" http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-scale-based-on-demand.html
If PercentChangeInCapacity returns a value between 0 and 1,