diff --git a/.gitignore b/.gitignore index 0db23098e..3ed3980af 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# UV +uv.lock + # Terraform-related files *.tfstate *.tfstate.backup diff --git a/tests/registry/test_templates.py b/tests/registry/test_templates.py index 5a0b639b8..0588b41f1 100644 --- a/tests/registry/test_templates.py +++ b/tests/registry/test_templates.py @@ -4,6 +4,14 @@ import yaml from tracecat.registry.actions.models import TemplateAction +from tracecat.registry.repository import Repository + + +@pytest.fixture(scope="module") +def registry(): + registry = Repository() + registry.init(include_base=False, include_templates=True) + return registry @pytest.mark.anyio @@ -12,9 +20,15 @@ list(Path("registry/tracecat_registry/templates").rglob("*.yml")), ids=lambda path: str(path.parts[-2:]), ) -async def test_template_action_validation(file_path): +async def test_template_action_validation(file_path, registry): with open(file_path) as file: template = yaml.safe_load(file) + + # Test parsing action = TemplateAction(**template) assert action.type == "action" assert action.definition + + # Test registration + registry.register_template_action(action) + assert action.definition.action in registry