mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
@@ -199,7 +199,7 @@ def test_devices_by_status(client, api_token, test_mac):
|
||||
assert "★" 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))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# !/usr/bin/env python3
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Comprehensive SQL Injection Prevention Tests for NetAlertX
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# !/usr/bin/env python3
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Pytest-based Mount Diagnostic Tests for NetAlertX
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user