Skip to content

Commit 29da04d

Browse files
committed
tests again
1 parent 5abe075 commit 29da04d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/unit/test_sql_injection_protection.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import pytest
66

7-
from async_cassandra import AsyncSession
7+
from async_cassandra import AsyncCassandraSession
88

99

1010
class TestSQLInjectionProtection:
@@ -14,7 +14,7 @@ class TestSQLInjectionProtection:
1414
async def test_prepared_statements_used_for_user_input(self):
1515
"""Test that all user inputs use prepared statements."""
1616
# Create mock session
17-
mock_session = AsyncMock(spec=AsyncSession)
17+
mock_session = AsyncMock(spec=AsyncCassandraSession)
1818
mock_stmt = AsyncMock()
1919
mock_session.prepare.return_value = mock_stmt
2020

@@ -31,7 +31,7 @@ async def test_prepared_statements_used_for_user_input(self):
3131
async def test_update_query_no_dynamic_sql(self):
3232
"""Test that UPDATE queries don't use dynamic SQL construction."""
3333
# Create mock session
34-
mock_session = AsyncMock(spec=AsyncSession)
34+
mock_session = AsyncMock(spec=AsyncCassandraSession)
3535
mock_stmt = AsyncMock()
3636
mock_session.prepare.return_value = mock_stmt
3737

@@ -57,7 +57,7 @@ async def test_update_query_no_dynamic_sql(self):
5757
async def test_table_name_validation_before_use(self):
5858
"""Test that table names are validated before use in queries."""
5959
# Create mock session
60-
mock_session = AsyncMock(spec=AsyncSession)
60+
mock_session = AsyncMock(spec=AsyncCassandraSession)
6161

6262
# Mock validation query response
6363
mock_result = MagicMock()
@@ -88,7 +88,7 @@ async def test_table_name_validation_before_use(self):
8888
async def test_no_string_interpolation_in_queries(self):
8989
"""Test that queries don't use string interpolation with user input."""
9090
# Create mock session
91-
mock_session = AsyncMock(spec=AsyncSession)
91+
mock_session = AsyncMock(spec=AsyncCassandraSession)
9292
mock_stmt = AsyncMock()
9393
mock_session.prepare.return_value = mock_stmt
9494

@@ -111,7 +111,7 @@ async def test_no_string_interpolation_in_queries(self):
111111
async def test_hardcoded_keyspace_names(self):
112112
"""Test that keyspace names are hardcoded, not from user input."""
113113
# Create mock session
114-
mock_session = AsyncMock(spec=AsyncSession)
114+
mock_session = AsyncMock(spec=AsyncCassandraSession)
115115

116116
# Good: Hardcoded keyspace names
117117
await mock_session.execute(
@@ -138,7 +138,7 @@ async def test_hardcoded_keyspace_names(self):
138138
async def test_streaming_queries_use_prepared_statements(self):
139139
"""Test that streaming queries use prepared statements."""
140140
# Create mock session
141-
mock_session = AsyncMock(spec=AsyncSession)
141+
mock_session = AsyncMock(spec=AsyncCassandraSession)
142142
mock_stmt = AsyncMock()
143143
mock_session.prepare.return_value = mock_stmt
144144
mock_session.execute_stream.return_value = AsyncMock()

0 commit comments

Comments
 (0)