Skip some tests for py3 since boto is not compatible yet.

This commit is contained in:
Steve Pulec 2015-01-11 16:39:39 -05:00
parent 4c40f39a68
commit 1ca651e106
2 changed files with 16 additions and 0 deletions

View File

@ -1,6 +1,7 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import boto import boto
from nose.plugins.skip import SkipTest from nose.plugins.skip import SkipTest
import six
def version_tuple(v): def version_tuple(v):
@ -23,3 +24,10 @@ class requires_boto_gte(object):
if boto_version >= required: if boto_version >= required:
return test return test
return skip_test return skip_test
class disable_on_py3(object):
def __call__(self, test):
if not six.PY3:
return test
return skip_test

View File

@ -6,8 +6,10 @@ from boto.exception import BotoServerError
import sure # noqa import sure # noqa
from moto import mock_ec2, mock_rds from moto import mock_ec2, mock_rds
from tests.helpers import disable_on_py3
@disable_on_py3()
@mock_rds @mock_rds
def test_create_database(): def test_create_database():
conn = boto.rds.connect_to_region("us-west-2") 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') database.security_groups[0].name.should.equal('my_sg')
@disable_on_py3()
@mock_rds @mock_rds
def test_get_databases(): def test_get_databases():
conn = boto.rds.connect_to_region("us-west-2") 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) conn.get_all_dbinstances.when.called_with("not-a-db").should.throw(BotoServerError)
@disable_on_py3()
@mock_rds @mock_rds
def test_delete_database(): def test_delete_database():
conn = boto.rds.connect_to_region("us-west-2") 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) conn.delete_dbsecurity_group.when.called_with("not-a-db").should.throw(BotoServerError)
@disable_on_py3()
@mock_rds @mock_rds
def test_security_group_authorize(): def test_security_group_authorize():
conn = boto.rds.connect_to_region("us-west-2") 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') security_group.ip_ranges[0].cidr_ip.should.equal('10.3.2.45/32')
@disable_on_py3()
@mock_rds @mock_rds
def test_add_security_group_to_database(): def test_add_security_group_to_database():
conn = boto.rds.connect_to_region("us-west-2") 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) conn.delete_db_subnet_group.when.called_with("db_subnet1").should.throw(BotoServerError)
@disable_on_py3()
@mock_ec2 @mock_ec2
@mock_rds @mock_rds
def test_create_database_in_subnet_group(): 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") database.subnet_group.name.should.equal("db_subnet1")
@disable_on_py3()
@mock_rds @mock_rds
def test_create_database_replica(): def test_create_database_replica():
conn = boto.rds.connect_to_region("us-west-2") conn = boto.rds.connect_to_region("us-west-2")