Testing new version of decorator.
This commit is contained in:
parent
d3df810065
commit
fde721bed7
123 changed files with 2740 additions and 1114 deletions
|
|
@ -5,12 +5,12 @@ import boto.vpc
|
|||
from boto.exception import BotoServerError
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_ec2, mock_rds
|
||||
from moto import mock_ec2_deprecated, mock_rds_deprecated
|
||||
from tests.helpers import disable_on_py3
|
||||
|
||||
|
||||
@disable_on_py3()
|
||||
@mock_rds
|
||||
@mock_rds_deprecated
|
||||
def test_create_database():
|
||||
conn = boto.rds.connect_to_region("us-west-2")
|
||||
|
||||
|
|
@ -27,7 +27,7 @@ def test_create_database():
|
|||
|
||||
|
||||
@disable_on_py3()
|
||||
@mock_rds
|
||||
@mock_rds_deprecated
|
||||
def test_get_databases():
|
||||
conn = boto.rds.connect_to_region("us-west-2")
|
||||
|
||||
|
|
@ -44,14 +44,14 @@ def test_get_databases():
|
|||
databases[0].id.should.equal("db-master-1")
|
||||
|
||||
|
||||
@mock_rds
|
||||
@mock_rds_deprecated
|
||||
def test_describe_non_existant_database():
|
||||
conn = boto.rds.connect_to_region("us-west-2")
|
||||
conn.get_all_dbinstances.when.called_with("not-a-db").should.throw(BotoServerError)
|
||||
|
||||
|
||||
@disable_on_py3()
|
||||
@mock_rds
|
||||
@mock_rds_deprecated
|
||||
def test_delete_database():
|
||||
conn = boto.rds.connect_to_region("us-west-2")
|
||||
list(conn.get_all_dbinstances()).should.have.length_of(0)
|
||||
|
|
@ -63,13 +63,13 @@ def test_delete_database():
|
|||
list(conn.get_all_dbinstances()).should.have.length_of(0)
|
||||
|
||||
|
||||
@mock_rds
|
||||
@mock_rds_deprecated
|
||||
def test_delete_non_existant_database():
|
||||
conn = boto.rds.connect_to_region("us-west-2")
|
||||
conn.delete_dbinstance.when.called_with("not-a-db").should.throw(BotoServerError)
|
||||
|
||||
|
||||
@mock_rds
|
||||
@mock_rds_deprecated
|
||||
def test_create_database_security_group():
|
||||
conn = boto.rds.connect_to_region("us-west-2")
|
||||
|
||||
|
|
@ -79,7 +79,7 @@ def test_create_database_security_group():
|
|||
list(security_group.ip_ranges).should.equal([])
|
||||
|
||||
|
||||
@mock_rds
|
||||
@mock_rds_deprecated
|
||||
def test_get_security_groups():
|
||||
conn = boto.rds.connect_to_region("us-west-2")
|
||||
|
||||
|
|
@ -96,13 +96,13 @@ def test_get_security_groups():
|
|||
databases[0].name.should.equal("db_sg1")
|
||||
|
||||
|
||||
@mock_rds
|
||||
@mock_rds_deprecated
|
||||
def test_get_non_existant_security_group():
|
||||
conn = boto.rds.connect_to_region("us-west-2")
|
||||
conn.get_all_dbsecurity_groups.when.called_with("not-a-sg").should.throw(BotoServerError)
|
||||
|
||||
|
||||
@mock_rds
|
||||
@mock_rds_deprecated
|
||||
def test_delete_database_security_group():
|
||||
conn = boto.rds.connect_to_region("us-west-2")
|
||||
conn.create_dbsecurity_group('db_sg', 'DB Security Group')
|
||||
|
|
@ -113,14 +113,14 @@ def test_delete_database_security_group():
|
|||
list(conn.get_all_dbsecurity_groups()).should.have.length_of(0)
|
||||
|
||||
|
||||
@mock_rds
|
||||
@mock_rds_deprecated
|
||||
def test_delete_non_existant_security_group():
|
||||
conn = boto.rds.connect_to_region("us-west-2")
|
||||
conn.delete_dbsecurity_group.when.called_with("not-a-db").should.throw(BotoServerError)
|
||||
|
||||
|
||||
@disable_on_py3()
|
||||
@mock_rds
|
||||
@mock_rds_deprecated
|
||||
def test_security_group_authorize():
|
||||
conn = boto.rds.connect_to_region("us-west-2")
|
||||
security_group = conn.create_dbsecurity_group('db_sg', 'DB Security Group')
|
||||
|
|
@ -133,7 +133,7 @@ def test_security_group_authorize():
|
|||
|
||||
|
||||
@disable_on_py3()
|
||||
@mock_rds
|
||||
@mock_rds_deprecated
|
||||
def test_add_security_group_to_database():
|
||||
conn = boto.rds.connect_to_region("us-west-2")
|
||||
|
||||
|
|
@ -147,8 +147,8 @@ def test_add_security_group_to_database():
|
|||
database.security_groups[0].name.should.equal("db_sg")
|
||||
|
||||
|
||||
@mock_ec2
|
||||
@mock_rds
|
||||
@mock_ec2_deprecated
|
||||
@mock_rds_deprecated
|
||||
def test_add_database_subnet_group():
|
||||
vpc_conn = boto.vpc.connect_to_region("us-west-2")
|
||||
vpc = vpc_conn.create_vpc("10.0.0.0/16")
|
||||
|
|
@ -163,8 +163,8 @@ def test_add_database_subnet_group():
|
|||
list(subnet_group.subnet_ids).should.equal(subnet_ids)
|
||||
|
||||
|
||||
@mock_ec2
|
||||
@mock_rds
|
||||
@mock_ec2_deprecated
|
||||
@mock_rds_deprecated
|
||||
def test_describe_database_subnet_group():
|
||||
vpc_conn = boto.vpc.connect_to_region("us-west-2")
|
||||
vpc = vpc_conn.create_vpc("10.0.0.0/16")
|
||||
|
|
@ -180,8 +180,8 @@ def test_describe_database_subnet_group():
|
|||
conn.get_all_db_subnet_groups.when.called_with("not-a-subnet").should.throw(BotoServerError)
|
||||
|
||||
|
||||
@mock_ec2
|
||||
@mock_rds
|
||||
@mock_ec2_deprecated
|
||||
@mock_rds_deprecated
|
||||
def test_delete_database_subnet_group():
|
||||
vpc_conn = boto.vpc.connect_to_region("us-west-2")
|
||||
vpc = vpc_conn.create_vpc("10.0.0.0/16")
|
||||
|
|
@ -198,8 +198,8 @@ def test_delete_database_subnet_group():
|
|||
|
||||
|
||||
@disable_on_py3()
|
||||
@mock_ec2
|
||||
@mock_rds
|
||||
@mock_ec2_deprecated
|
||||
@mock_rds_deprecated
|
||||
def test_create_database_in_subnet_group():
|
||||
vpc_conn = boto.vpc.connect_to_region("us-west-2")
|
||||
vpc = vpc_conn.create_vpc("10.0.0.0/16")
|
||||
|
|
@ -216,7 +216,7 @@ def test_create_database_in_subnet_group():
|
|||
|
||||
|
||||
@disable_on_py3()
|
||||
@mock_rds
|
||||
@mock_rds_deprecated
|
||||
def test_create_database_replica():
|
||||
conn = boto.rds.connect_to_region("us-west-2")
|
||||
|
||||
|
|
@ -239,7 +239,7 @@ def test_create_database_replica():
|
|||
list(primary.read_replica_dbinstance_identifiers).should.have.length_of(0)
|
||||
|
||||
@disable_on_py3()
|
||||
@mock_rds
|
||||
@mock_rds_deprecated
|
||||
def test_create_cross_region_database_replica():
|
||||
west_1_conn = boto.rds.connect_to_region("us-west-1")
|
||||
west_2_conn = boto.rds.connect_to_region("us-west-2")
|
||||
|
|
@ -266,7 +266,7 @@ def test_create_cross_region_database_replica():
|
|||
|
||||
|
||||
@disable_on_py3()
|
||||
@mock_rds
|
||||
@mock_rds_deprecated
|
||||
def test_connecting_to_us_east_1():
|
||||
# boto does not use us-east-1 in the URL for RDS,
|
||||
# and that broke moto in the past:
|
||||
|
|
@ -286,7 +286,7 @@ def test_connecting_to_us_east_1():
|
|||
|
||||
|
||||
@disable_on_py3()
|
||||
@mock_rds
|
||||
@mock_rds_deprecated
|
||||
def test_create_database_with_iops():
|
||||
conn = boto.rds.connect_to_region("us-west-2")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue