Skip to content

Commit eedf51a

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent bf6425d commit eedf51a

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

plugins/sub_plugins/validate/jsonschema.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,11 @@ def _validate_jsonschema(self):
282282

283283
suppress_fields = []
284284
if suppress_output:
285-
suppress_fields = suppress_output if isinstance(suppress_output, list) else ["found", "relative_schema"]
285+
suppress_fields = (
286+
suppress_output
287+
if isinstance(suppress_output, list)
288+
else ["found", "relative_schema"]
289+
)
286290

287291
for validation_error in validation_errors:
288292
if isinstance(validation_error, jsonschema.ValidationError):

tests/unit/plugins/action/test_validate.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def test_suppress_output_is_false(self):
308308
}
309309

310310
result = self._plugin.run(task_vars=None)
311-
error = result.get('errors', [])[0]
311+
error = result.get("errors", [])[0]
312312
self.assertIn("found", error)
313313
self.assertIn("relative_schema", error)
314314

@@ -322,7 +322,7 @@ def test_suppress_output_is_true(self):
322322
}
323323

324324
result = self._plugin.run(task_vars=dict(ansible_validate_jsonschema_suppress_output=True))
325-
error = result.get('errors', [])[0]
325+
error = result.get("errors", [])[0]
326326
self.assertNotIn("found", error)
327327
self.assertNotIn("relative_schema", error)
328328

@@ -335,7 +335,9 @@ def test_suppress_output_is_a_list(self):
335335
"criteria": CRITERIA_FORMAT_SUPPORT_CHECK,
336336
}
337337

338-
result = self._plugin.run(task_vars=dict(ansible_validate_jsonschema_suppress_output=['relative_schema']))
339-
error = result.get('errors', [])[0]
338+
result = self._plugin.run(
339+
task_vars=dict(ansible_validate_jsonschema_suppress_output=["relative_schema"])
340+
)
341+
error = result.get("errors", [])[0]
340342
self.assertIn("found", error)
341343
self.assertNotIn("relative_schema", error)

0 commit comments

Comments
 (0)