Skip to content

Commit

Permalink
Skip some tests for py3 since boto is not compatible yet.
Browse files Browse the repository at this point in the history
  • Loading branch information
spulec committed Jan 11, 2015
1 parent 4c40f39 commit 1ca651e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/helpers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import unicode_literals
import boto
from nose.plugins.skip import SkipTest
import six


def version_tuple(v):
Expand All @@ -23,3 +24,10 @@ def __call__(self, test):
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
8 changes: 8 additions & 0 deletions tests/test_rds/test_rds.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
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")
Expand All @@ -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")
Expand All @@ -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")
Expand Down Expand Up @@ -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")
Expand All @@ -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")
Expand Down Expand Up @@ -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():
Expand All @@ -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")
Expand Down

0 comments on commit 1ca651e

Please sign in to comment.