mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-03 07:41:30 -07: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:
parent
71a6dcdf3e
commit
a5c9726502
154 changed files with 671 additions and 1113 deletions
|
@ -20,7 +20,8 @@ from __future__ import (absolute_import, division, print_function)
|
|||
__metaclass__ = type
|
||||
|
||||
from ansible.compat.tests.mock import patch, MagicMock
|
||||
from .junos_module import TestJunosModule, set_module_args
|
||||
from units.modules.utils import set_module_args
|
||||
from .junos_module import TestJunosModule
|
||||
jnpr_mock = MagicMock()
|
||||
|
||||
modules = {
|
||||
|
@ -41,10 +42,10 @@ class TestJunosCommandModule(TestJunosModule):
|
|||
module = junos_package
|
||||
|
||||
def setUp(self):
|
||||
pass
|
||||
super(TestJunosCommandModule, self).setUp()
|
||||
|
||||
def tearDown(self):
|
||||
pass
|
||||
super(TestJunosCommandModule, self).tearDown()
|
||||
|
||||
def test_junos_package_src(self):
|
||||
set_module_args(dict(src='junos-vsrx-12.1X46-D10.2-domestic.tgz'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue