Skip to content

Commit c939d9b

Browse files
committed
Add a couple tests for cursor attrs; #5
1 parent e8fcacf commit c939d9b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,18 @@ def test_get_cursor_gets_a_cursor(self):
6767
actual = cursor.fetchall()
6868
assert actual == [{"bar": "baz"}, {"bar": "buz"}]
6969

70+
def test_we_can_use_cursor_rowcount(self):
71+
with self.db.get_cursor() as cursor:
72+
cursor.execute("SELECT * FROM foo ORDER BY bar")
73+
actual = cursor.rowcount
74+
assert actual == 2
75+
76+
def test_we_can_use_cursor_closed(self):
77+
with self.db.get_cursor() as cursor:
78+
cursor.execute("SELECT * FROM foo ORDER BY bar")
79+
actual = cursor.closed
80+
assert not actual
81+
7082

7183
class TestTransaction(WithData):
7284

0 commit comments

Comments
 (0)