From 1fdd84b88c0fa4296bce45f0b0608159956981f7 Mon Sep 17 00:00:00 2001 From: Sloane Hertel Date: Fri, 13 Jul 2018 10:56:57 -0400 Subject: [PATCH] Rename AWS unit tests that are not running when changing the module (#42712) now can use `ansible-test units module_name` for the aws_s3 and aws_api_gateway modules changes to modules/cloud/amazon/aws_api_gateway and modules/cloud/amazon/aws_s3 are not triggering the unit tests; also fix aws_s3 from importing non-exist module and skipping tests changes to module_utils/aws/core.py are only being unit tested on modules that import from the file (if they have a corresponding test) or tests that import from the file themselves. --- .../{test_api_gateway.py => test_aws_api_gateway.py} | 0 .../modules/cloud/amazon/{test_s3.py => test_aws_s3.py} | 9 +-------- 2 files changed, 1 insertion(+), 8 deletions(-) rename test/units/modules/cloud/amazon/{test_api_gateway.py => test_aws_api_gateway.py} (100%) rename test/units/modules/cloud/amazon/{test_s3.py => test_aws_s3.py} (74%) diff --git a/test/units/modules/cloud/amazon/test_api_gateway.py b/test/units/modules/cloud/amazon/test_aws_api_gateway.py similarity index 100% rename from test/units/modules/cloud/amazon/test_api_gateway.py rename to test/units/modules/cloud/amazon/test_aws_api_gateway.py diff --git a/test/units/modules/cloud/amazon/test_s3.py b/test/units/modules/cloud/amazon/test_aws_s3.py similarity index 74% rename from test/units/modules/cloud/amazon/test_s3.py rename to test/units/modules/cloud/amazon/test_aws_s3.py index 70966b2dc4..9b17502822 100644 --- a/test/units/modules/cloud/amazon/test_s3.py +++ b/test/units/modules/cloud/amazon/test_aws_s3.py @@ -3,7 +3,7 @@ import pytest import unittest try: - import ansible.modules.cloud.amazon.s3 as s3 + import ansible.modules.cloud.amazon.aws_s3 as s3 except ImportError: pytestmark = pytest.mark.skip("This test requires the s3 Python libraries") @@ -24,13 +24,6 @@ class TestUrlparse(unittest.TestCase): actual = s3.is_fakes3("fakes3://bla.blubb") self.assertEqual(True, actual) - def test_is_walrus(self): - actual = s3.is_walrus("trulywalrus_but_invalid_url") - # I don't know if this makes sense, but this is the current behaviour... - self.assertEqual(True, actual) - actual = s3.is_walrus("http://notwalrus.amazonaws.com") - self.assertEqual(False, actual) - def test_get_s3_connection(self): aws_connect_kwargs = dict(aws_access_key_id="access_key", aws_secret_access_key="secret_key")