diff --git a/tests/helpers.py b/tests/helpers.py index 2532548cd..33509c06e 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -1,6 +1,7 @@ from __future__ import unicode_literals import boto from nose.plugins.skip import SkipTest +import six def version_tuple(v): @@ -23,3 +24,10 @@ class requires_boto_gte(object): if boto_version >= required: return test return skip_test + + +class disable_on_py3(object): + def __call__(self, test): + if not six.PY3: + return test + return skip_test diff --git a/tests/test_rds/test_rds.py b/tests/test_rds/test_rds.py index 02c644103..80644ef3e 100644 --- a/tests/test_rds/test_rds.py +++ b/tests/test_rds/test_rds.py @@ -6,8 +6,10 @@ from boto.exception import BotoServerError import sure # noqa from moto import mock_ec2, mock_rds +from tests.helpers import disable_on_py3 +@disable_on_py3() @mock_rds def test_create_database(): conn = boto.rds.connect_to_region("us-west-2") @@ -24,6 +26,7 @@ def test_create_database(): database.security_groups[0].name.should.equal('my_sg') +@disable_on_py3() @mock_rds def test_get_databases(): conn = boto.rds.connect_to_region("us-west-2") @@ -47,6 +50,7 @@ def test_describe_non_existant_database(): conn.get_all_dbinstances.when.called_with("not-a-db").should.throw(BotoServerError) +@disable_on_py3() @mock_rds def test_delete_database(): conn = boto.rds.connect_to_region("us-west-2") @@ -115,6 +119,7 @@ def test_delete_non_existant_security_group(): conn.delete_dbsecurity_group.when.called_with("not-a-db").should.throw(BotoServerError) +@disable_on_py3() @mock_rds def test_security_group_authorize(): conn = boto.rds.connect_to_region("us-west-2") @@ -127,6 +132,7 @@ def test_security_group_authorize(): security_group.ip_ranges[0].cidr_ip.should.equal('10.3.2.45/32') +@disable_on_py3() @mock_rds def test_add_security_group_to_database(): conn = boto.rds.connect_to_region("us-west-2") @@ -191,6 +197,7 @@ def test_delete_database_subnet_group(): conn.delete_db_subnet_group.when.called_with("db_subnet1").should.throw(BotoServerError) +@disable_on_py3() @mock_ec2 @mock_rds def test_create_database_in_subnet_group(): @@ -208,6 +215,7 @@ def test_create_database_in_subnet_group(): database.subnet_group.name.should.equal("db_subnet1") +@disable_on_py3() @mock_rds def test_create_database_replica(): conn = boto.rds.connect_to_region("us-west-2")