From 50175c58c06cc8898507c97f2bafe2b9517cf83d Mon Sep 17 00:00:00 2001 From: "Shiny Brar (he/il)" Date: Wed, 31 Jan 2024 23:37:08 -0500 Subject: [PATCH] test(validate): added tests for function and command validation --- tests/test_validate.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/test_validate.py diff --git a/tests/test_validate.py b/tests/test_validate.py new file mode 100644 index 0000000..519ecd1 --- /dev/null +++ b/tests/test_validate.py @@ -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