From a01b831bd311a46d940b35e244ffba83fa0bbab3 Mon Sep 17 00:00:00 2001
From: Felix Fontein <felix@fontein.de>
Date: Sun, 22 Mar 2020 22:09:21 +0100
Subject: [PATCH] Fix more includes.

---
 .../network/f5/test_bigip_security_address_list.py        | 8 ++++----
 .../modules/network/f5/test_bigip_security_port_list.py   | 8 ++++----
 .../fortimanager/test_fmgr_device_provision_template.py   | 3 ++-
 tests/unit/modules/network/ingate/test_ig_config.py       | 3 ++-
 .../modules/network/ingate/test_ig_unit_information.py    | 6 ++++--
 .../modules/remote_management/oneview/hpe_test_utils.py   | 4 ++--
 6 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/tests/unit/modules/network/f5/test_bigip_security_address_list.py b/tests/unit/modules/network/f5/test_bigip_security_address_list.py
index 15ae345836..b7c600b097 100644
--- a/tests/unit/modules/network/f5/test_bigip_security_address_list.py
+++ b/tests/unit/modules/network/f5/test_bigip_security_address_list.py
@@ -28,10 +28,10 @@ try:
     from test.unit.modules.utils import set_module_args
 except ImportError:
     try:
-        from ansible.modules.network.f5.bigip_security_address_list import ApiParameters
-        from ansible.modules.network.f5.bigip_security_address_list import ModuleParameters
-        from ansible.modules.network.f5.bigip_security_address_list import ModuleManager
-        from ansible.modules.network.f5.bigip_security_address_list import ArgumentSpec
+        from ansible_collections.community.general.plugins.modules.network.f5.bigip_security_address_list import ApiParameters
+        from ansible_collections.community.general.plugins.modules.network.f5.bigip_security_address_list import ModuleParameters
+        from ansible_collections.community.general.plugins.modules.network.f5.bigip_security_address_list import ModuleManager
+        from ansible_collections.community.general.plugins.modules.network.f5.bigip_security_address_list import ArgumentSpec
         from ansible_collections.community.general.tests.unit.modules.utils import set_module_args
     except ImportError:
         pytestmark.append(pytest.mark.skip("F5 Ansible modules require the f5-sdk Python library"))
diff --git a/tests/unit/modules/network/f5/test_bigip_security_port_list.py b/tests/unit/modules/network/f5/test_bigip_security_port_list.py
index 0d94465e0c..4f86a41219 100644
--- a/tests/unit/modules/network/f5/test_bigip_security_port_list.py
+++ b/tests/unit/modules/network/f5/test_bigip_security_port_list.py
@@ -28,10 +28,10 @@ try:
     from test.unit.modules.utils import set_module_args
 except ImportError:
     try:
-        from ansible.modules.network.f5.bigip_security_port_list import ApiParameters
-        from ansible.modules.network.f5.bigip_security_port_list import ModuleParameters
-        from ansible.modules.network.f5.bigip_security_port_list import ModuleManager
-        from ansible.modules.network.f5.bigip_security_port_list import ArgumentSpec
+        from ansible_collections.community.general.plugins.modules.network.f5.bigip_security_port_list import ApiParameters
+        from ansible_collections.community.general.plugins.modules.network.f5.bigip_security_port_list import ModuleParameters
+        from ansible_collections.community.general.plugins.modules.network.f5.bigip_security_port_list import ModuleManager
+        from ansible_collections.community.general.plugins.modules.network.f5.bigip_security_port_list import ArgumentSpec
         from ansible_collections.community.general.tests.unit.modules.utils import set_module_args
     except ImportError:
         pytestmark.append(pytest.mark.skip("F5 Ansible modules require the f5-sdk Python library"))
diff --git a/tests/unit/modules/network/fortimanager/test_fmgr_device_provision_template.py b/tests/unit/modules/network/fortimanager/test_fmgr_device_provision_template.py
index fb41979518..be8e8b49e3 100644
--- a/tests/unit/modules/network/fortimanager/test_fmgr_device_provision_template.py
+++ b/tests/unit/modules/network/fortimanager/test_fmgr_device_provision_template.py
@@ -47,7 +47,8 @@ def module_mock(mocker):
 
 @pytest.fixture(autouse=True)
 def connection_mock(mocker):
-    connection_class_mock = mocker.patch('ansible.modules.network.fortimanager.'
+    connection_class_mock = mocker.patch('ansible_collections.community.general.'
+                                         'plugins.modules.network.fortimanager.'
                                          'fmgr_device_provision_template.Connection')
     return connection_class_mock
 
diff --git a/tests/unit/modules/network/ingate/test_ig_config.py b/tests/unit/modules/network/ingate/test_ig_config.py
index 65c204db91..3f710d3e01 100644
--- a/tests/unit/modules/network/ingate/test_ig_config.py
+++ b/tests/unit/modules/network/ingate/test_ig_config.py
@@ -35,7 +35,8 @@ class TestConfigModule(TestIngateModule):
     def setUp(self):
         super(TestConfigModule, self).setUp()
 
-        self.mock_make_request = patch('ansible.modules.network.ingate.'
+        self.mock_make_request = patch('ansible_collections.community.general.'
+                                       'plugins.modules.network.ingate.'
                                        'ig_config.make_request')
         self.make_request = self.mock_make_request.start()
         # ATM the Ingate Python SDK is not needed in this unit test.
diff --git a/tests/unit/modules/network/ingate/test_ig_unit_information.py b/tests/unit/modules/network/ingate/test_ig_unit_information.py
index cfa4438e51..9761e2365c 100644
--- a/tests/unit/modules/network/ingate/test_ig_unit_information.py
+++ b/tests/unit/modules/network/ingate/test_ig_unit_information.py
@@ -21,11 +21,13 @@ class TestUnitInformationModule(TestIngateModule):
     def setUp(self):
         super(TestUnitInformationModule, self).setUp()
 
-        self.mock_make_request = patch('ansible.modules.network.ingate.'
+        self.mock_make_request = patch('ansible_collections.community.general.'
+                                       'plugins.modules.network.ingate.'
                                        'ig_unit_information.make_request')
         self.make_request = self.mock_make_request.start()
 
-        self.mock_is_ingatesdk_installed = patch('ansible.modules.network.ingate.'
+        self.mock_is_ingatesdk_installed = patch('ansible_collections.community.general.'
+                                                 'plugins.modules.network.ingate.'
                                                  'ig_unit_information.is_ingatesdk_installed')
         self.is_ingatesdk_installed = self.mock_is_ingatesdk_installed.start()
 
diff --git a/tests/unit/modules/remote_management/oneview/hpe_test_utils.py b/tests/unit/modules/remote_management/oneview/hpe_test_utils.py
index 1da6bac2df..301ed75cc8 100644
--- a/tests/unit/modules/remote_management/oneview/hpe_test_utils.py
+++ b/tests/unit/modules/remote_management/oneview/hpe_test_utils.py
@@ -40,7 +40,7 @@ class OneViewBaseTest(object):
         resource_module_path_name = 'oneview_' + str.join('_', resource_module_path_name).lower()
 
         ansible = __import__('ansible')
-        oneview_module = ansible.modules.remote_management.oneview
+        oneview_module = ansible_collections.community.general.plugins.modules.remote_management.oneview
         resource_module = getattr(oneview_module, resource_module_path_name)
         self.testing_class = getattr(resource_module, resource_name)
         testing_module = self.testing_class.__module__.split('.')[-1]
@@ -145,7 +145,7 @@ class OneViewBaseTestCase(object):
         # Load scenarios from module examples (Also checks if it is a valid yaml)
         ansible = __import__('ansible')
         testing_module = self.testing_class.__module__.split('.')[-1]
-        self.testing_module = getattr(ansible.modules.remote_management.oneview, testing_module)
+        self.testing_module = getattr(ansible_collections.community.general.plugins.modules.remote_management.oneview, testing_module)
 
         try:
             # Load scenarios from module examples (Also checks if it is a valid yaml)