summaryrefslogtreecommitdiff
path: root/test/units/modules/network/nxos/test_nxos_vrf_af.py
diff options
context:
space:
mode:
authorPilou <pierre-louis@libregerbil.fr>2017-11-17 18:17:07 +0100
committerMatt Clay <matt@mystile.com>2017-11-17 09:17:07 -0800
commita5c9726502a0f15f03da9f8b38141a6de81631ec (patch)
tree1c8208edc5c53cba018582394a132b2efc7f510b /test/units/modules/network/nxos/test_nxos_vrf_af.py
parent71a6dcdf3e528bd088b1399b9dcf3cfb62ae0f36 (diff)
downloadansible-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/nxos/test_nxos_vrf_af.py')
-rw-r--r--test/units/modules/network/nxos/test_nxos_vrf_af.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/units/modules/network/nxos/test_nxos_vrf_af.py b/test/units/modules/network/nxos/test_nxos_vrf_af.py
index 42f985bdbf..834f75c0f3 100644
--- a/test/units/modules/network/nxos/test_nxos_vrf_af.py
+++ b/test/units/modules/network/nxos/test_nxos_vrf_af.py
@@ -19,11 +19,9 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
-import json
-
from ansible.compat.tests.mock import patch
from ansible.modules.network.nxos import nxos_vrf_af
-from .nxos_module import TestNxosModule, load_fixture, set_module_args
+from .nxos_module import TestNxosModule, set_module_args
class TestNxosVrfafModule(TestNxosModule):
@@ -31,6 +29,8 @@ class TestNxosVrfafModule(TestNxosModule):
module = nxos_vrf_af
def setUp(self):
+ super(TestNxosVrfafModule, self).setUp()
+
self.mock_load_config = patch('ansible.modules.network.nxos.nxos_vrf_af.load_config')
self.load_config = self.mock_load_config.start()
@@ -38,6 +38,7 @@ class TestNxosVrfafModule(TestNxosModule):
self.get_config = self.mock_get_config.start()
def tearDown(self):
+ super(TestNxosVrfafModule, self).tearDown()
self.mock_load_config.stop()
self.mock_get_config.stop()