BE: linting fixes 2

Signed-off-by: jokob-sk <jokob.sk@gmail.com>
This commit is contained in:
jokob-sk
2025-11-22 20:43:36 +11:00
parent 5c14b34a8b
commit ebeb7a07af
63 changed files with 124 additions and 113 deletions

View File

@@ -199,7 +199,7 @@ def test_devices_by_status(client, api_token, test_mac):
assert "&#9733" in fav_data["title"]
def test_delete_test_devices(client, api_token, test_mac):
def test_delete_test_devices(client, api_token):
# Delete by MAC
resp = client.delete("/devices", json={"macs": ["AA:BB:CC:*"]}, headers=auth_headers(api_token))

View File

@@ -1,4 +1,4 @@
# !/usr/bin/env python3
#!/usr/bin/env python3
"""
Comprehensive SQL Injection Prevention Tests for NetAlertX

View File

@@ -210,7 +210,6 @@ class TestDatabaseParameterSupport(unittest.TestCase):
# This should not cause SQL injection
malicious_input = "'; DROP TABLE test_table; --"
cursor.execute("SELECT * FROM test_table WHERE name = :name", {'name': malicious_input})
# results = cursor.fetchall()
# The table should still exist and be queryable
cursor.execute("SELECT COUNT(*) FROM test_table")

View File

@@ -1,4 +1,4 @@
# !/usr/bin/env python3
#!/usr/bin/env python3
"""
Pytest-based Mount Diagnostic Tests for NetAlertX

View File

@@ -19,7 +19,8 @@ from messaging.reporting import get_notifications # noqa: E402 [flake8 lint sup
@pytest.fixture
def test_db_path():
path = tempfile.mktemp(suffix=".db")
with tempfile.NamedTemporaryFile(suffix=".db", delete=False) as tmp:
path = tmp.name
yield path
if os.path.exists(path):
os.remove(path)