Skip to content

Commit

Permalink
Fix unit tests. Time to add some githooks...
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph-flinn committed Jan 12, 2024
1 parent 9d91c1f commit 527c41b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lint-workflow/tests/rules/test_name_capitalized.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def fixture_missing_name_workflow():
return WorkflowBuilder.build(workflow=yaml.load(workflow), from_file=False)


@pytest.fixture(rule="rule")
@pytest.fixture(name="rule")
def fixture_rule():
return RuleNameCapitalized()

Expand Down
9 changes: 7 additions & 2 deletions lint-workflow/tests/rules/test_name_exists.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
"""Test src/rules/name_exists.py."""
import pytest

from ruamel.yaml import YAML

from src.load import WorkflowBuilder
from src.rules.name_exists import RuleNameExists


yaml = YAML()


@pytest.fixture(name="correct_workflow")
def fixture_correct_workflow():
workflow = """\
Expand All @@ -22,7 +27,7 @@ def fixture_correct_workflow():
- name: Test
run: echo test
"""
return WorkflowBuilder.build(workflow=workflow, from_file=False)
return WorkflowBuilder.build(workflow=yaml.load(workflow), from_file=False)


@pytest.fixture(name="incorrect_workflow")
Expand All @@ -38,7 +43,7 @@ def fixture_incorrect_workflow():
steps:
- run: echo test
"""
return WorkflowBuilder.build(workflow=workflow, from_file=False)
return WorkflowBuilder.build(workflow=yaml.load(workflow), from_file=False)


@pytest.fixture(name="rule")
Expand Down

0 comments on commit 527c41b

Please sign in to comment.