forked from username/flaskpaste
tests: fix mypy type errors in security tests
This commit is contained in:
@@ -47,7 +47,7 @@ def test_trusted_path_validation():
|
||||
]
|
||||
|
||||
for path, expected, desc in trusted_tests + untrusted_tests:
|
||||
result = is_trusted_clipboard_path(path)
|
||||
result = is_trusted_clipboard_path(path) # type: ignore[operator]
|
||||
status = "PASS" if result == expected else "FAIL"
|
||||
results.append((status, desc, path, expected, result))
|
||||
print(f" {status}: {desc}")
|
||||
@@ -76,7 +76,7 @@ def test_path_injection():
|
||||
os.environ["PATH"] = f"/tmp:{original_path}" # noqa: S108
|
||||
|
||||
# Try to find clipboard command
|
||||
cmd = find_clipboard_command(CLIPBOARD_READ_COMMANDS)
|
||||
cmd = find_clipboard_command(CLIPBOARD_READ_COMMANDS) # type: ignore[operator]
|
||||
|
||||
# Restore PATH
|
||||
os.environ["PATH"] = original_path
|
||||
@@ -159,7 +159,7 @@ def test_config_permissions():
|
||||
|
||||
stderr_capture = io.StringIO()
|
||||
with redirect_stderr(stderr_capture):
|
||||
check_config_permissions(config_path)
|
||||
check_config_permissions(config_path) # type: ignore[operator]
|
||||
|
||||
warning = stderr_capture.getvalue()
|
||||
|
||||
@@ -173,7 +173,7 @@ def test_config_permissions():
|
||||
config_path.chmod(0o600)
|
||||
stderr_capture = io.StringIO()
|
||||
with redirect_stderr(stderr_capture):
|
||||
check_config_permissions(config_path)
|
||||
check_config_permissions(config_path) # type: ignore[operator]
|
||||
|
||||
warning = stderr_capture.getvalue()
|
||||
if not warning:
|
||||
|
||||
Reference in New Issue
Block a user