Replace self.module by my_module (#75196)

While implementing basic Ansible module testing I realised that the `self.module` used in some places is not actually a thing, and I changed to `my_module` to make it work as I understand it was expected.
pull/75256/head
Christian Adell 3 years ago committed by GitHub
parent 1e00099753
commit 3ba2243ba3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -369,7 +369,7 @@ Here is a simple mock of :meth:`AnsibleModule.run_command` (taken from :file:`te
with patch.object(basic.AnsibleModule, 'run_command') as run_command:
run_command.return_value = 0, '', '' # successful execution, no output
with self.assertRaises(AnsibleExitJson) as result:
self.module.main()
my_module.main()
self.assertFalse(result.exception.args[0]['changed'])
# Check that run_command has been called
run_command.assert_called_once_with('/usr/bin/command args')
@ -443,7 +443,7 @@ mock for :meth:`Ansible.get_bin_path`::
def test_module_fail_when_required_args_missing(self):
with self.assertRaises(AnsibleFailJson):
set_module_args({})
self.module.main()
my_module.main()
def test_ensure_command_called(self):
@ -508,7 +508,7 @@ This now makes it possible to run tests against the module initiation function::
})
with self.assertRaises(AnsibleFailJson) as result:
self.module.setup_json
my_module.setup_json
See also ``test/units/module_utils/aws/test_rds.py``

Loading…
Cancel
Save