diff options
author | Pilou <pierre-louis@libregerbil.fr> | 2017-11-17 18:17:07 +0100 |
---|---|---|
committer | Matt Clay <matt@mystile.com> | 2017-11-17 09:17:07 -0800 |
commit | a5c9726502a0f15f03da9f8b38141a6de81631ec (patch) | |
tree | 1c8208edc5c53cba018582394a132b2efc7f510b /test/units/modules/network/f5/test_bigip_iapplx_package.py | |
parent | 71a6dcdf3e528bd088b1399b9dcf3cfb62ae0f36 (diff) | |
download | ansible-a5c9726502a0f15f03da9f8b38141a6de81631ec.tar.gz |
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'
Diffstat (limited to 'test/units/modules/network/f5/test_bigip_iapplx_package.py')
-rw-r--r-- | test/units/modules/network/f5/test_bigip_iapplx_package.py | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/test/units/modules/network/f5/test_bigip_iapplx_package.py b/test/units/modules/network/f5/test_bigip_iapplx_package.py index 3ddc252cf7..4d44c7b6c0 100644 --- a/test/units/modules/network/f5/test_bigip_iapplx_package.py +++ b/test/units/modules/network/f5/test_bigip_iapplx_package.py @@ -15,10 +15,9 @@ if sys.version_info < (2, 7): raise SkipTest("F5 Ansible modules require Python >= 2.7") from ansible.compat.tests import unittest -from ansible.module_utils import basic from ansible.compat.tests.mock import patch, Mock -from ansible.module_utils._text import to_bytes from ansible.module_utils.f5_utils import AnsibleF5Client +from units.modules.utils import set_module_args try: from library.bigip_iapp_template import Parameters @@ -38,11 +37,6 @@ fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures') fixture_data = {} -def set_module_args(args): - args = json.dumps({'ANSIBLE_MODULE_ARGS': args}) - basic._ANSIBLE_ARGS = to_bytes(args) - - def load_fixture(name): path = os.path.join(fixture_path, name) |