15 lines
453 B
Python
15 lines
453 B
Python
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
|