Skip to content

Commit ea7ddf3

Browse files
author
Peng Ren
committed
Fix test cases
1 parent d661d9f commit ea7ddf3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/test_cursor.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def test_execute_simple_select(self):
3838
rows = self.cursor.result_set.fetchall()
3939

4040
# Should return 19 users with age > 25 from the test dataset
41-
assert len(rows) == 1 # 19 out of 22 users are over 25
41+
assert len(rows) == 19 # 19 out of 22 users are over 25
4242
if len(rows) > 0:
4343
assert "name" in rows[0]
4444
assert "email" in rows[0]
@@ -101,15 +101,15 @@ def test_execute_with_sort(self):
101101
assert isinstance(self.cursor.result_set, ResultSet)
102102
rows = self.cursor.result_set.fetchall()
103103

104-
# Should return all 2 users sorted by age descending
105-
assert len(rows) == 2
104+
# Should return all 22 users sorted by age descending
105+
assert len(rows) == 22
106106

107107
# Check that names are present
108108
assert all("name" in row for row in rows)
109109

110110
# Verify that we have actual user names from the dataset
111111
names = [row["name"] for row in rows]
112-
assert "John" in names # First user from dataset
112+
assert "John Doe" in names # First user from dataset
113113

114114
def test_execute_complex_query(self):
115115
"""Test executing complex query with multiple clauses"""
@@ -164,7 +164,7 @@ def test_execute_with_aliases(self):
164164
rows = self.cursor.result_set.fetchall()
165165

166166
# Should return users with aliased field names
167-
assert len(rows) == 2
167+
assert len(rows) == 22
168168

169169
# Check that alias fields are present if aliasing works
170170
for row in rows:
@@ -229,11 +229,11 @@ def test_fetchall_with_result(self):
229229

230230
# Test fetchall
231231
rows = self.cursor.fetchall()
232-
assert len(rows) == 2 # Should get all 22 test users
232+
assert len(rows) == 22 # Should get all 22 test users
233233

234234
# Verify all rows have expected structure
235235
names = [row["name"] for row in rows]
236-
assert "John" in names # First user from dataset
236+
assert "John Doe" in names # First user from dataset
237237

238238
def test_close(self):
239239
"""Test cursor close"""

0 commit comments

Comments
 (0)