-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(validate): added tests for function and command validation
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |