diff --git a/tests/test_validators/test_security.py b/tests/test_validators/test_security.py new file mode 100644 index 0000000..2f7164d --- /dev/null +++ b/tests/test_validators/test_security.py @@ -0,0 +1,14 @@ +import pytest +from src.validators import SecurityValidator + +class TestSecurityValidator: + def setup_method(self): + self.validator = SecurityValidator() + + def test_detect_unquoted_variable(self): + findings = self.validator.check("cp $SRC_DIR $DEST_DIR") + assert len(findings) >= 1 + + def test_safe_quoted_variables(self): + findings = self.validator.check('cp "$SRC_DIR" "$DEST_DIR"') + assert len(findings) == 0