Skip to content

Commit

Permalink
test(validate): added tests for function and command validation
Browse files Browse the repository at this point in the history
  • Loading branch information
shinybrar committed Feb 1, 2024
1 parent 3458f0b commit 50175c5
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/test_validate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from os import chown

import pytest

from workflow.lifecycle.validate import command, function


def test_validate_function():
"""Test the validate function function."""
result = function("os.chown")
assert result == chown

# Test function import error
with pytest.raises(ImportError):
function("os.path")


def test_validate_command():
"""Test the validate command function."""
result = command("ls")
assert result is True

# Test invalid command
result = command("invalid_command")
assert result is False

0 comments on commit 50175c5

Please sign in to comment.