mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
[PR #11115/58bb1e7c backport][stable-12] fix ruff case B007 (#11131)
fix ruff case B007 (#11115)
* fix ruff case B007
* rollback inventory/iocage
* re-do the fix in inventory/iocage
* add cases in tests/unit/plugins
* rollback plugins/module_utils/memset.py
* rollback extraneous changes in plugins/modules/xcc_redfish_command.py
* add changelog frag
(cherry picked from commit 58bb1e7c04)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
@@ -91,7 +91,7 @@ def test_get_jails(inventory):
|
||||
def test_get_properties(inventory):
|
||||
results = {"_meta": {"hostvars": {}}}
|
||||
inventory.get_jails(inventory.jails, results)
|
||||
for hostname, host_vars in results["_meta"]["hostvars"].items():
|
||||
for hostname in results["_meta"]["hostvars"]:
|
||||
inventory.get_properties(inventory.prpts[hostname], results, hostname)
|
||||
assert results == inventory.ps_ok
|
||||
|
||||
@@ -99,7 +99,7 @@ def test_get_properties(inventory):
|
||||
def test_populate(inventory, mocker):
|
||||
results = {"_meta": {"hostvars": {}}}
|
||||
inventory.get_jails(inventory.jails, results)
|
||||
for hostname, host_vars in results["_meta"]["hostvars"].items():
|
||||
for hostname in results["_meta"]["hostvars"]:
|
||||
inventory.get_properties(inventory.prpts[hostname], results, hostname)
|
||||
inventory.get_option = mocker.MagicMock(side_effect=get_option)
|
||||
inventory.populate(results)
|
||||
|
||||
@@ -145,7 +145,7 @@ def test_invalid_csv(data, dialect, dialect_params, fieldnames):
|
||||
result = False
|
||||
|
||||
try:
|
||||
for row in reader:
|
||||
for _row in reader:
|
||||
continue
|
||||
except csv.CSVError:
|
||||
result = True
|
||||
|
||||
@@ -96,9 +96,9 @@ class TestPritunlOrg(ModuleTestCase):
|
||||
# except for changed which should be false the second time
|
||||
for k, v in idempotent_exc.items():
|
||||
if k == "changed":
|
||||
self.assertFalse(idempotent_exc[k])
|
||||
self.assertFalse(v)
|
||||
else:
|
||||
self.assertEqual(create_exc[k], idempotent_exc[k])
|
||||
self.assertEqual(create_exc[k], v)
|
||||
|
||||
def test_absent(self):
|
||||
"""Test organization removal from Pritunl."""
|
||||
|
||||
Reference in New Issue
Block a user