Fix linting errors; fix some real bugs (#5111)

* Fix linting errors.

* Fix bugs.

* Another linter error ignored.

* More fixes.

* Ignore sanity errors with older versions.

ci_complete

* Forgot to commit more changes.
This commit is contained in:
Felix Fontein 2022-08-12 11:07:30 +02:00 committed by GitHub
commit a54af8909c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
52 changed files with 115 additions and 94 deletions

View file

@ -75,8 +75,8 @@ class TestMyModule():
}
mod_obj.params = args
lxca_cmms.main()
assert(mock.call(argument_spec=expected_arguments_spec,
supports_check_mode=False) == ansible_mod_cls.call_args)
assert mock.call(argument_spec=expected_arguments_spec,
supports_check_mode=False) == ansible_mod_cls.call_args
@mock.patch('ansible_collections.community.general.plugins.module_utils.remote_management.lxca.common.setup_conn', autospec=True)
@mock.patch('ansible_collections.community.general.plugins.modules.remote_management.lxca.lxca_cmms._cmms_by_uuid',

View file

@ -79,8 +79,8 @@ class TestMyModule():
}
mod_obj.params = args
lxca_nodes.main()
assert(mock.call(argument_spec=expected_arguments_spec,
supports_check_mode=False) == ansible_mod_cls.call_args)
assert mock.call(argument_spec=expected_arguments_spec,
supports_check_mode=False) == ansible_mod_cls.call_args
@mock.patch('ansible_collections.community.general.plugins.module_utils.remote_management.lxca.common.setup_conn', autospec=True)
@mock.patch('ansible_collections.community.general.plugins.modules.remote_management.lxca.lxca_nodes._nodes_by_uuid',

View file

@ -315,9 +315,9 @@ class TestPmem(ModuleTestCase):
test_result = result.exception.args[0]['result']
expected = json.loads(namespace)
for i, notuse in enumerate(test_result):
self.assertEqual(test_result[i]['dev'], expected[i]['dev'])
self.assertEqual(test_result[i]['size'], expected[i]['size'])
for i, result in enumerate(test_result):
self.assertEqual(result['dev'], expected[i]['dev'])
self.assertEqual(result['size'], expected[i]['size'])
def test_fail_when_required_args_missing(self):
with self.assertRaises(AnsibleFailJson):