summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Chappell <mchappel@redhat.com>2019-10-30 17:48:59 +0100
committerJill R <4121322+jillr@users.noreply.github.com>2019-10-30 09:48:59 -0700
commite6607d611aeb21962e87907f85f8a84886b644e3 (patch)
tree45f653a6c58cf7b9c085933c68441514314b1392
parente9f8a34dce4576cdbbeb10c9c03c495b4475eda9 (diff)
downloadansible-e6607d611aeb21962e87907f85f8a84886b644e3.tar.gz
Sanity test fixups - AWS related tests (#64093)
* AWS tests Sanity Test fixups (add boilerplate) * Remove sanity ignore.txt entries
-rwxr-xr-xtest/integration/targets/inventory_aws_conformance/inventory_diff.py3
-rw-r--r--test/integration/targets/inventory_aws_conformance/lib/boto/__init__.py3
-rw-r--r--test/integration/targets/inventory_aws_conformance/lib/boto/ec2/__init__.py3
-rw-r--r--test/integration/targets/inventory_aws_conformance/lib/boto/elasticache/__init__.py4
-rw-r--r--test/integration/targets/inventory_aws_conformance/lib/boto/exception.py3
-rw-r--r--test/integration/targets/inventory_aws_conformance/lib/boto/exceptions.py3
-rw-r--r--test/integration/targets/inventory_aws_conformance/lib/boto/mocks/instances.py3
-rw-r--r--test/integration/targets/inventory_aws_conformance/lib/boto/session.py3
-rw-r--r--test/legacy/cleanup_ec2.py3
-rw-r--r--test/sanity/ignore.txt47
-rw-r--r--test/units/module_utils/ec2/test_aws.py17
-rw-r--r--test/units/module_utils/test_ec2.py18
-rw-r--r--test/units/modules/cloud/amazon/test_aws_api_gateway.py16
-rw-r--r--test/units/modules/cloud/amazon/test_aws_direct_connect_connection.py18
-rw-r--r--test/units/modules/cloud/amazon/test_aws_direct_connect_link_aggregation_group.py18
-rw-r--r--test/units/modules/cloud/amazon/test_aws_s3.py4
-rw-r--r--test/units/modules/cloud/amazon/test_cloudformation.py18
-rw-r--r--test/units/modules/cloud/amazon/test_data_pipeline.py18
-rw-r--r--test/units/modules/cloud/amazon/test_ec2_group.py4
-rw-r--r--test/units/modules/cloud/amazon/test_iam_password_policy.py4
-rw-r--r--test/units/modules/cloud/amazon/test_kinesis_stream.py4
-rw-r--r--test/units/modules/cloud/amazon/test_lambda.py15
-rw-r--r--test/units/modules/cloud/amazon/test_lambda_policy.py15
-rw-r--r--test/units/modules/cloud/amazon/test_redshift_cross_region_snapshots.py4
-rw-r--r--test/units/modules/cloud/amazon/test_route53_zone.py4
-rw-r--r--test/units/modules/cloud/amazon/test_s3_bucket_notification.py4
26 files changed, 90 insertions, 166 deletions
diff --git a/test/integration/targets/inventory_aws_conformance/inventory_diff.py b/test/integration/targets/inventory_aws_conformance/inventory_diff.py
index f50df11b86..3aaeff50b4 100755
--- a/test/integration/targets/inventory_aws_conformance/inventory_diff.py
+++ b/test/integration/targets/inventory_aws_conformance/inventory_diff.py
@@ -1,5 +1,8 @@
#!/usr/bin/env python
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
import json
import sys
diff --git a/test/integration/targets/inventory_aws_conformance/lib/boto/__init__.py b/test/integration/targets/inventory_aws_conformance/lib/boto/__init__.py
index 794d39542e..ede07eeae5 100644
--- a/test/integration/targets/inventory_aws_conformance/lib/boto/__init__.py
+++ b/test/integration/targets/inventory_aws_conformance/lib/boto/__init__.py
@@ -1,2 +1,5 @@
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
import boto.exceptions as exceptions # pylint: disable=useless-import-alias
import boto.session as session # pylint: disable=useless-import-alias
diff --git a/test/integration/targets/inventory_aws_conformance/lib/boto/ec2/__init__.py b/test/integration/targets/inventory_aws_conformance/lib/boto/ec2/__init__.py
index a95dfe5318..e590be6395 100644
--- a/test/integration/targets/inventory_aws_conformance/lib/boto/ec2/__init__.py
+++ b/test/integration/targets/inventory_aws_conformance/lib/boto/ec2/__init__.py
@@ -1,5 +1,8 @@
# boto2
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
from boto.mocks.instances import BotoInstance, Reservation
diff --git a/test/integration/targets/inventory_aws_conformance/lib/boto/elasticache/__init__.py b/test/integration/targets/inventory_aws_conformance/lib/boto/elasticache/__init__.py
index e8060797bc..4da41601a4 100644
--- a/test/integration/targets/inventory_aws_conformance/lib/boto/elasticache/__init__.py
+++ b/test/integration/targets/inventory_aws_conformance/lib/boto/elasticache/__init__.py
@@ -1,3 +1,7 @@
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
+
class Connection(object):
def __init__(self):
pass
diff --git a/test/integration/targets/inventory_aws_conformance/lib/boto/exception.py b/test/integration/targets/inventory_aws_conformance/lib/boto/exception.py
index 4617c2896f..0179d5d75f 100644
--- a/test/integration/targets/inventory_aws_conformance/lib/boto/exception.py
+++ b/test/integration/targets/inventory_aws_conformance/lib/boto/exception.py
@@ -1,3 +1,6 @@
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
class BotoServerError(Exception):
pass
diff --git a/test/integration/targets/inventory_aws_conformance/lib/boto/exceptions.py b/test/integration/targets/inventory_aws_conformance/lib/boto/exceptions.py
index 4617c2896f..0179d5d75f 100644
--- a/test/integration/targets/inventory_aws_conformance/lib/boto/exceptions.py
+++ b/test/integration/targets/inventory_aws_conformance/lib/boto/exceptions.py
@@ -1,3 +1,6 @@
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
class BotoServerError(Exception):
pass
diff --git a/test/integration/targets/inventory_aws_conformance/lib/boto/mocks/instances.py b/test/integration/targets/inventory_aws_conformance/lib/boto/mocks/instances.py
index fd8e33f126..9511a1dbaa 100644
--- a/test/integration/targets/inventory_aws_conformance/lib/boto/mocks/instances.py
+++ b/test/integration/targets/inventory_aws_conformance/lib/boto/mocks/instances.py
@@ -1,3 +1,6 @@
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
from ansible.module_utils.common._collections_compat import MutableMapping
import datetime
diff --git a/test/integration/targets/inventory_aws_conformance/lib/boto/session.py b/test/integration/targets/inventory_aws_conformance/lib/boto/session.py
index 4624c30616..8e3d79f660 100644
--- a/test/integration/targets/inventory_aws_conformance/lib/boto/session.py
+++ b/test/integration/targets/inventory_aws_conformance/lib/boto/session.py
@@ -1,6 +1,9 @@
#!/usr/bin/env python
# boto3
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
from boto.mocks.instances import Boto3Instance
diff --git a/test/legacy/cleanup_ec2.py b/test/legacy/cleanup_ec2.py
index 734fd15f00..65a8cc2264 100644
--- a/test/legacy/cleanup_ec2.py
+++ b/test/legacy/cleanup_ec2.py
@@ -4,6 +4,9 @@ Find and delete AWS resources matching the provided --match string. Unless
Please use caution, you can easily delete you're *ENTIRE* EC2 infrastructure.
'''
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
import boto
import boto.ec2.elb
import optparse
diff --git a/test/sanity/ignore.txt b/test/sanity/ignore.txt
index b876c961d8..7dd1e6e0af 100644
--- a/test/sanity/ignore.txt
+++ b/test/sanity/ignore.txt
@@ -5803,22 +5803,6 @@ test/integration/targets/ignore_unreachable/fake_connectors/bad_exec.py future-i
test/integration/targets/ignore_unreachable/fake_connectors/bad_exec.py metaclass-boilerplate
test/integration/targets/ignore_unreachable/fake_connectors/bad_put_file.py future-import-boilerplate
test/integration/targets/ignore_unreachable/fake_connectors/bad_put_file.py metaclass-boilerplate
-test/integration/targets/inventory_aws_conformance/inventory_diff.py future-import-boilerplate
-test/integration/targets/inventory_aws_conformance/inventory_diff.py metaclass-boilerplate
-test/integration/targets/inventory_aws_conformance/lib/boto/__init__.py future-import-boilerplate
-test/integration/targets/inventory_aws_conformance/lib/boto/__init__.py metaclass-boilerplate
-test/integration/targets/inventory_aws_conformance/lib/boto/ec2/__init__.py future-import-boilerplate
-test/integration/targets/inventory_aws_conformance/lib/boto/ec2/__init__.py metaclass-boilerplate
-test/integration/targets/inventory_aws_conformance/lib/boto/elasticache/__init__.py future-import-boilerplate
-test/integration/targets/inventory_aws_conformance/lib/boto/elasticache/__init__.py metaclass-boilerplate
-test/integration/targets/inventory_aws_conformance/lib/boto/exception.py future-import-boilerplate
-test/integration/targets/inventory_aws_conformance/lib/boto/exception.py metaclass-boilerplate
-test/integration/targets/inventory_aws_conformance/lib/boto/exceptions.py future-import-boilerplate
-test/integration/targets/inventory_aws_conformance/lib/boto/exceptions.py metaclass-boilerplate
-test/integration/targets/inventory_aws_conformance/lib/boto/mocks/instances.py future-import-boilerplate
-test/integration/targets/inventory_aws_conformance/lib/boto/mocks/instances.py metaclass-boilerplate
-test/integration/targets/inventory_aws_conformance/lib/boto/session.py future-import-boilerplate
-test/integration/targets/inventory_aws_conformance/lib/boto/session.py metaclass-boilerplate
test/integration/targets/inventory_kubevirt_conformance/inventory_diff.py future-import-boilerplate
test/integration/targets/inventory_kubevirt_conformance/inventory_diff.py metaclass-boilerplate
test/integration/targets/inventory_kubevirt_conformance/server.py future-import-boilerplate
@@ -5923,8 +5907,6 @@ test/integration/targets/win_script/files/test_script_with_splatting.ps1 pslint:
test/integration/targets/win_stat/library/test_symlink_file.ps1 pslint:PSCustomUseLiteralPath
test/integration/targets/win_template/files/foo.dos.txt line-endings
test/integration/targets/win_user_right/library/test_get_right.ps1 pslint:PSCustomUseLiteralPath
-test/legacy/cleanup_ec2.py future-import-boilerplate
-test/legacy/cleanup_ec2.py metaclass-boilerplate
test/legacy/cleanup_gce.py future-import-boilerplate
test/legacy/cleanup_gce.py metaclass-boilerplate
test/legacy/cleanup_gce.py pylint:blacklisted-name
@@ -5968,8 +5950,6 @@ test/units/module_utils/common/test_dict_transformations.py future-import-boiler
test/units/module_utils/common/test_dict_transformations.py metaclass-boilerplate
test/units/module_utils/conftest.py future-import-boilerplate
test/units/module_utils/conftest.py metaclass-boilerplate
-test/units/module_utils/ec2/test_aws.py future-import-boilerplate
-test/units/module_utils/ec2/test_aws.py metaclass-boilerplate
test/units/module_utils/facts/base.py future-import-boilerplate
test/units/module_utils/facts/hardware/test_sunos_get_uptime_facts.py future-import-boilerplate
test/units/module_utils/facts/hardware/test_sunos_get_uptime_facts.py metaclass-boilerplate
@@ -6022,8 +6002,6 @@ test/units/module_utils/test_database.py future-import-boilerplate
test/units/module_utils/test_database.py metaclass-boilerplate
test/units/module_utils/test_distro.py future-import-boilerplate
test/units/module_utils/test_distro.py metaclass-boilerplate
-test/units/module_utils/test_ec2.py future-import-boilerplate
-test/units/module_utils/test_ec2.py metaclass-boilerplate
test/units/module_utils/test_hetzner.py future-import-boilerplate
test/units/module_utils/test_hetzner.py metaclass-boilerplate
test/units/module_utils/test_kubevirt.py future-import-boilerplate
@@ -6038,37 +6016,12 @@ test/units/module_utils/xenserver/FakeAnsibleModule.py future-import-boilerplate
test/units/module_utils/xenserver/FakeAnsibleModule.py metaclass-boilerplate
test/units/module_utils/xenserver/FakeXenAPI.py future-import-boilerplate
test/units/module_utils/xenserver/FakeXenAPI.py metaclass-boilerplate
-test/units/modules/cloud/amazon/test_aws_api_gateway.py metaclass-boilerplate
-test/units/modules/cloud/amazon/test_aws_direct_connect_connection.py future-import-boilerplate
-test/units/modules/cloud/amazon/test_aws_direct_connect_connection.py metaclass-boilerplate
-test/units/modules/cloud/amazon/test_aws_direct_connect_link_aggregation_group.py future-import-boilerplate
-test/units/modules/cloud/amazon/test_aws_direct_connect_link_aggregation_group.py metaclass-boilerplate
-test/units/modules/cloud/amazon/test_aws_s3.py future-import-boilerplate
-test/units/modules/cloud/amazon/test_aws_s3.py metaclass-boilerplate
-test/units/modules/cloud/amazon/test_cloudformation.py future-import-boilerplate
-test/units/modules/cloud/amazon/test_cloudformation.py metaclass-boilerplate
-test/units/modules/cloud/amazon/test_data_pipeline.py future-import-boilerplate
-test/units/modules/cloud/amazon/test_data_pipeline.py metaclass-boilerplate
-test/units/modules/cloud/amazon/test_ec2_group.py future-import-boilerplate
-test/units/modules/cloud/amazon/test_ec2_group.py metaclass-boilerplate
test/units/modules/cloud/amazon/test_ec2_vpc_nat_gateway.py future-import-boilerplate
test/units/modules/cloud/amazon/test_ec2_vpc_nat_gateway.py metaclass-boilerplate
test/units/modules/cloud/amazon/test_ec2_vpc_nat_gateway.py pylint:blacklisted-name
test/units/modules/cloud/amazon/test_ec2_vpc_vpn.py future-import-boilerplate
test/units/modules/cloud/amazon/test_ec2_vpc_vpn.py metaclass-boilerplate
test/units/modules/cloud/amazon/test_ec2_vpc_vpn.py pylint:blacklisted-name
-test/units/modules/cloud/amazon/test_iam_password_policy.py future-import-boilerplate
-test/units/modules/cloud/amazon/test_iam_password_policy.py metaclass-boilerplate
-test/units/modules/cloud/amazon/test_kinesis_stream.py future-import-boilerplate
-test/units/modules/cloud/amazon/test_kinesis_stream.py metaclass-boilerplate
-test/units/modules/cloud/amazon/test_lambda.py metaclass-boilerplate
-test/units/modules/cloud/amazon/test_lambda_policy.py metaclass-boilerplate
-test/units/modules/cloud/amazon/test_redshift_cross_region_snapshots.py future-import-boilerplate
-test/units/modules/cloud/amazon/test_redshift_cross_region_snapshots.py metaclass-boilerplate
-test/units/modules/cloud/amazon/test_route53_zone.py future-import-boilerplate
-test/units/modules/cloud/amazon/test_route53_zone.py metaclass-boilerplate
-test/units/modules/cloud/amazon/test_s3_bucket_notification.py future-import-boilerplate
-test/units/modules/cloud/amazon/test_s3_bucket_notification.py metaclass-boilerplate
test/units/modules/cloud/google/test_gce_tag.py future-import-boilerplate
test/units/modules/cloud/google/test_gce_tag.py metaclass-boilerplate
test/units/modules/cloud/google/test_gcp_forwarding_rule.py future-import-boilerplate
diff --git a/test/units/module_utils/ec2/test_aws.py b/test/units/module_utils/ec2/test_aws.py
index 6e566eee85..9ef6e9e04e 100644
--- a/test/units/module_utils/ec2/test_aws.py
+++ b/test/units/module_utils/ec2/test_aws.py
@@ -2,19 +2,10 @@
# (c) 2015, Allen Sanabria <asanabria@linuxdynasty.org>
#
# This file is part of Ansible
-#
-# Ansible is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Ansible is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
+# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
try:
import boto3
diff --git a/test/units/module_utils/test_ec2.py b/test/units/module_utils/test_ec2.py
index eb6e956288..dc748276e2 100644
--- a/test/units/module_utils/test_ec2.py
+++ b/test/units/module_utils/test_ec2.py
@@ -1,21 +1,11 @@
# (c) 2017 Red Hat Inc.
#
# This file is part of Ansible
-#
-# Ansible is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Ansible is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
+# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
-# (c) 2017 Red Hat Inc.
import unittest
from ansible.module_utils.ec2 import map_complex_type, compare_policies
diff --git a/test/units/modules/cloud/amazon/test_aws_api_gateway.py b/test/units/modules/cloud/amazon/test_aws_api_gateway.py
index 52bd55f4c2..30b0120a11 100644
--- a/test/units/modules/cloud/amazon/test_aws_api_gateway.py
+++ b/test/units/modules/cloud/amazon/test_aws_api_gateway.py
@@ -2,23 +2,11 @@
# (c) 2016 Michael De La Rue
#
# This file is part of Ansible
-#
-# Ansible is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Ansible is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
+# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
-
from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import sys
diff --git a/test/units/modules/cloud/amazon/test_aws_direct_connect_connection.py b/test/units/modules/cloud/amazon/test_aws_direct_connect_connection.py
index 3ca3c061c1..d232b51095 100644
--- a/test/units/modules/cloud/amazon/test_aws_direct_connect_connection.py
+++ b/test/units/modules/cloud/amazon/test_aws_direct_connect_connection.py
@@ -1,19 +1,11 @@
# (c) 2017 Red Hat Inc.
#
# This file is part of Ansible
-#
-# Ansible is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Ansible is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
+# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+
+# Make coding more python3-ish
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
from units.utils.amazon_placebo_fixtures import placeboify, maybe_sleep
from ansible.modules.cloud.amazon import aws_direct_connect_connection
diff --git a/test/units/modules/cloud/amazon/test_aws_direct_connect_link_aggregation_group.py b/test/units/modules/cloud/amazon/test_aws_direct_connect_link_aggregation_group.py
index 0506741b8d..1f733aeb4c 100644
--- a/test/units/modules/cloud/amazon/test_aws_direct_connect_link_aggregation_group.py
+++ b/test/units/modules/cloud/amazon/test_aws_direct_connect_link_aggregation_group.py
@@ -1,19 +1,11 @@
# (c) 2017 Red Hat Inc.
#
# This file is part of Ansible
-#
-# Ansible is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Ansible is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
+# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+
+# Make coding more python3-ish
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import pytest
import os
diff --git a/test/units/modules/cloud/amazon/test_aws_s3.py b/test/units/modules/cloud/amazon/test_aws_s3.py
index 9b17502822..a752c67fcb 100644
--- a/test/units/modules/cloud/amazon/test_aws_s3.py
+++ b/test/units/modules/cloud/amazon/test_aws_s3.py
@@ -1,3 +1,7 @@
+# Make coding more python3-ish
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
import pytest
import unittest
diff --git a/test/units/modules/cloud/amazon/test_cloudformation.py b/test/units/modules/cloud/amazon/test_cloudformation.py
index 99fa5d8772..dd6caa2da0 100644
--- a/test/units/modules/cloud/amazon/test_cloudformation.py
+++ b/test/units/modules/cloud/amazon/test_cloudformation.py
@@ -1,19 +1,11 @@
# (c) 2017 Red Hat Inc.
#
# This file is part of Ansible
-#
-# Ansible is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Ansible is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
+# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+
+# Make coding more python3-ish
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import pytest
diff --git a/test/units/modules/cloud/amazon/test_data_pipeline.py b/test/units/modules/cloud/amazon/test_data_pipeline.py
index 499a9b0561..7d821b3993 100644
--- a/test/units/modules/cloud/amazon/test_data_pipeline.py
+++ b/test/units/modules/cloud/amazon/test_data_pipeline.py
@@ -1,19 +1,11 @@
# (c) 2017 Red Hat Inc.
#
# This file is part of Ansible
-#
-# Ansible is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Ansible is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
+# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+
+# Make coding more python3-ish
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import os
import json
diff --git a/test/units/modules/cloud/amazon/test_ec2_group.py b/test/units/modules/cloud/amazon/test_ec2_group.py
index 33c9d69e41..14f597f69d 100644
--- a/test/units/modules/cloud/amazon/test_ec2_group.py
+++ b/test/units/modules/cloud/amazon/test_ec2_group.py
@@ -1,3 +1,7 @@
+# Make coding more python3-ish
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
from ansible.modules.cloud.amazon import ec2_group as group_module
diff --git a/test/units/modules/cloud/amazon/test_iam_password_policy.py b/test/units/modules/cloud/amazon/test_iam_password_policy.py
index d2e887b3d6..85b828a130 100644
--- a/test/units/modules/cloud/amazon/test_iam_password_policy.py
+++ b/test/units/modules/cloud/amazon/test_iam_password_policy.py
@@ -1,3 +1,7 @@
+# Make coding more python3-ish
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
import pytest
from units.modules.utils import set_module_args
diff --git a/test/units/modules/cloud/amazon/test_kinesis_stream.py b/test/units/modules/cloud/amazon/test_kinesis_stream.py
index 9aa8f01bd1..e549ae9d11 100644
--- a/test/units/modules/cloud/amazon/test_kinesis_stream.py
+++ b/test/units/modules/cloud/amazon/test_kinesis_stream.py
@@ -1,3 +1,7 @@
+# Make coding more python3-ish
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
import pytest
import unittest
diff --git a/test/units/modules/cloud/amazon/test_lambda.py b/test/units/modules/cloud/amazon/test_lambda.py
index 844b442ade..14ea2b454c 100644
--- a/test/units/modules/cloud/amazon/test_lambda.py
+++ b/test/units/modules/cloud/amazon/test_lambda.py
@@ -2,22 +2,11 @@
# (c) 2017 Michael De La Rue
#
# This file is part of Ansible
-#
-# Ansible is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Ansible is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
+# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import copy
import pytest
diff --git a/test/units/modules/cloud/amazon/test_lambda_policy.py b/test/units/modules/cloud/amazon/test_lambda_policy.py
index bc836d83f3..5c32370469 100644
--- a/test/units/modules/cloud/amazon/test_lambda_policy.py
+++ b/test/units/modules/cloud/amazon/test_lambda_policy.py
@@ -2,22 +2,11 @@
# (c) 2017 Michael De La Rue
#
# This file is part of Ansible
-#
-# Ansible is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Ansible is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
+# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import copy
diff --git a/test/units/modules/cloud/amazon/test_redshift_cross_region_snapshots.py b/test/units/modules/cloud/amazon/test_redshift_cross_region_snapshots.py
index 4a00a20691..1891b5c890 100644
--- a/test/units/modules/cloud/amazon/test_redshift_cross_region_snapshots.py
+++ b/test/units/modules/cloud/amazon/test_redshift_cross_region_snapshots.py
@@ -1,3 +1,7 @@
+# Make coding more python3-ish
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
from ansible.modules.cloud.amazon import redshift_cross_region_snapshots as rcrs
mock_status_enabled = {
diff --git a/test/units/modules/cloud/amazon/test_route53_zone.py b/test/units/modules/cloud/amazon/test_route53_zone.py
index e60e745e1a..283584a4dd 100644
--- a/test/units/modules/cloud/amazon/test_route53_zone.py
+++ b/test/units/modules/cloud/amazon/test_route53_zone.py
@@ -1,3 +1,7 @@
+# Make coding more python3-ish
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
import functools
from ansible.modules.cloud.amazon import route53_zone
diff --git a/test/units/modules/cloud/amazon/test_s3_bucket_notification.py b/test/units/modules/cloud/amazon/test_s3_bucket_notification.py
index 934a1a68e5..cf342064c0 100644
--- a/test/units/modules/cloud/amazon/test_s3_bucket_notification.py
+++ b/test/units/modules/cloud/amazon/test_s3_bucket_notification.py
@@ -1,3 +1,7 @@
+# Make coding more python3-ish
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
import pytest
from units.compat.mock import MagicMock, patch