mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Unit tests: share common code (#31456)
* move set_module_args to units.modules.utils * unit tests: reuse set_module_args * unit tests: mock exit/fail_json in module.utils.ModuleTestCase * unit tests: use module.utils.ModuleTestCase * unit tests: fix 'import shadowed by loop variable'
This commit is contained in:
@@ -18,7 +18,8 @@
|
||||
#
|
||||
|
||||
from ansible.compat.tests.mock import patch, Mock, MagicMock, call
|
||||
from .netscaler_module import TestModule, nitro_base_patcher, set_module_args
|
||||
from units.modules.utils import set_module_args
|
||||
from .netscaler_module import TestModule, nitro_base_patcher
|
||||
|
||||
import sys
|
||||
|
||||
@@ -53,12 +54,14 @@ class TestNetscalerServerModule(TestModule):
|
||||
cls.nitro_specific_patcher.stop()
|
||||
|
||||
def setUp(self):
|
||||
super(TestNetscalerServerModule, self).setUp()
|
||||
self.nitro_base_patcher.start()
|
||||
self.nitro_specific_patcher.start()
|
||||
|
||||
# Setup minimal required arguments to pass AnsibleModule argument parsing
|
||||
|
||||
def tearDown(self):
|
||||
super(TestNetscalerServerModule, self).tearDown()
|
||||
self.nitro_base_patcher.stop()
|
||||
self.nitro_specific_patcher.stop()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user