Add remaining test files
This commit is contained in:
14
tests/test_validators/test_security.py
Normal file
14
tests/test_validators/test_security.py
Normal file
@@ -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
|
||||||
Reference in New Issue
Block a user