From 8d0d5cb96349226a6c49a868ef933440bc6c6f2c Mon Sep 17 00:00:00 2001 From: Shawn Falkner-Horine Date: Wed, 10 Sep 2014 12:49:20 -0700 Subject: [PATCH 1/4] Tests: Fixed 'requires_boto_gte' to apply to target test only. --- tests/helpers.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/helpers.py b/tests/helpers.py index 0f8df72fe..6cc38f5d5 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -8,6 +8,11 @@ def version_tuple(v): return tuple(map(int, (v.split(".")))) +# Note: See https://github.com/spulec/moto/issues/201 for why this is a separate method. +def skip_test(): + raise SkipTest + + class requires_boto_gte(object): """Decorator for requiring boto version greater than or equal to 'version'""" def __init__(self, version): @@ -18,7 +23,7 @@ class requires_boto_gte(object): required = version_tuple(self.version) if boto_version >= required: return test - raise SkipTest + return skip_test class py3_requires_boto_gte(object): @@ -34,4 +39,4 @@ class py3_requires_boto_gte(object): required = version_tuple(self.version) if boto_version >= required: return test - raise SkipTest + return skip_test From 61d93bfcfc0b50feae02b7650353151410069274 Mon Sep 17 00:00:00 2001 From: Shawn Falkner-Horine Date: Wed, 10 Sep 2014 13:01:32 -0700 Subject: [PATCH 2/4] Tests: Tweaked a general test to be compatible with Boto 2.7, attribute check is redundant with a specific version-gated test. --- tests/test_autoscaling/test_launch_configurations.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_autoscaling/test_launch_configurations.py b/tests/test_autoscaling/test_launch_configurations.py index dc3e85ef5..d24480281 100644 --- a/tests/test_autoscaling/test_launch_configurations.py +++ b/tests/test_autoscaling/test_launch_configurations.py @@ -168,7 +168,6 @@ def test_create_launch_configuration_defaults(): launch_config.instance_monitoring.enabled.should.equal('false') launch_config.instance_profile_name.should.equal(None) launch_config.spot_price.should.equal(None) - launch_config.ebs_optimized.should.equal(False) @requires_boto_gte("2.12") From fd42d19f0e0fcbe2338a913264a1cd36ca5d72a6 Mon Sep 17 00:00:00 2001 From: Shawn Falkner-Horine Date: Wed, 10 Sep 2014 13:02:55 -0700 Subject: [PATCH 3/4] Tests: Tweaked two tests to be compatible with Boto 2.7, now-removed kwarg has its own version-gated test. --- tests/test_emr/test_emr.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/test_emr/test_emr.py b/tests/test_emr/test_emr.py index dd72b54b4..be23e3efe 100644 --- a/tests/test_emr/test_emr.py +++ b/tests/test_emr/test_emr.py @@ -99,7 +99,6 @@ def test_create_job_flow_visible_to_all_users(): job_id = conn.run_jobflow( name='My jobflow', log_uri='s3://some_bucket/jobflow_logs', - job_flow_role='some-role-arn', steps=[], visible_to_all_users=True, ) @@ -275,7 +274,6 @@ def test_set_visible_to_all_users(): job_id = conn.run_jobflow( name='My jobflow', log_uri='s3://some_bucket/jobflow_logs', - job_flow_role='some-role-arn', steps=[], visible_to_all_users=False, ) From 632ea41d5f5fdc85b3b04113691e6dd5170fb7fb Mon Sep 17 00:00:00 2001 From: Shawn Falkner-Horine Date: Wed, 10 Sep 2014 13:29:45 -0700 Subject: [PATCH 4/4] Tests: Tweaked two tests to be version-gated to Boto 2.8+. --- tests/test_emr/test_emr.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_emr/test_emr.py b/tests/test_emr/test_emr.py index be23e3efe..c8d5fca3b 100644 --- a/tests/test_emr/test_emr.py +++ b/tests/test_emr/test_emr.py @@ -92,6 +92,7 @@ def test_create_job_flow_with_new_params(): ) +@requires_boto_gte("2.8") @mock_emr def test_create_job_flow_visible_to_all_users(): conn = boto.connect_emr() @@ -267,6 +268,7 @@ def test_modify_instance_groups(): int(instance_group2.instancerunningcount).should.equal(3) +@requires_boto_gte("2.8") @mock_emr def test_set_visible_to_all_users(): conn = boto.connect_emr()