def setUp(self): super(TestNiosZoneModule, self).setUp() self.module = MagicMock(name='ansible_collections.ansible.infoblox.plugins.modules.nios_zone.WapiModule') self.module.check_mode = False self.module.params = {'provider': None} self.mock_wapi = patch('ansible_collections.ansible.infoblox.plugins.modules.nios_zone.WapiModule') self.exec_command = self.mock_wapi.start() self.mock_wapi_run = patch('ansible_collections.ansible.infoblox.plugins.modules.nios_zone.WapiModule.run') self.mock_wapi_run.start() self.load_config = self.mock_wapi_run.start()
def setUp(self): self.mock_module = patch.multiple(basic.AnsibleModule, exit_json=exit_json, fail_json=fail_json) self.mock_module.start() self.mock_sleep = patch('time.sleep') self.mock_sleep.start() set_module_args({}) self.addCleanup(self.mock_module.stop) self.addCleanup(self.mock_sleep.stop)