From 24b9f22b9b42d275213672cf3ac47187faba1197 Mon Sep 17 00:00:00 2001 From: Opeyemi Alao <54288773+Eeebru@users.noreply.github.com> Date: Thu, 28 Nov 2024 12:59:44 +0000 Subject: [PATCH] fix test --- src/bitwarden_workflow_linter/rules/underscore_outputs.py | 6 ++++-- tests/rules/test_underscore_output.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/bitwarden_workflow_linter/rules/underscore_outputs.py b/src/bitwarden_workflow_linter/rules/underscore_outputs.py index 1514ced..f3d3c1a 100644 --- a/src/bitwarden_workflow_linter/rules/underscore_outputs.py +++ b/src/bitwarden_workflow_linter/rules/underscore_outputs.py @@ -93,7 +93,6 @@ def fn(self, obj: Union[Workflow, Job, Step]) -> Tuple[bool, str]: for output, _ in obj.on["workflow_dispatch"]["outputs"].items(): outputs.append(output) - if obj.on.get("workflow_call"): if obj.on["workflow_call"].get("outputs"): for output, _ in obj.on["workflow_call"]["outputs"].items(): @@ -123,4 +122,7 @@ def fn(self, obj: Union[Workflow, Job, Step]) -> Tuple[bool, str]: if correct: return True, "" - return correct, f"{obj.__class__.__name__} {self.message}: ({' ,'.join(offending_keys)})" + return ( + False, + f"{obj.__class__.__name__} {self.message}: ({' ,'.join(offending_keys)})", + ) diff --git a/tests/rules/test_underscore_output.py b/tests/rules/test_underscore_output.py index dde79e0..e1228cf 100644 --- a/tests/rules/test_underscore_output.py +++ b/tests/rules/test_underscore_output.py @@ -234,7 +234,7 @@ def test_rule_on_incorrect_step(rule, incorrect_workflow): result, message = rule.fn(incorrect_workflow.jobs["job-key"].steps[1]) assert result is False - assert message == "Hyphen found in Step output: test-key-2" + assert "outputs with more than one word should use an underscore" in message result, _ = rule.fn(incorrect_workflow.jobs["job-key"].steps[2]) assert result is True