File tree 2 files changed +5
-1
lines changed
2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,7 @@ def record(self):
170
170
"""
171
171
return self ._current
172
172
173
+ @property
173
174
def position (self ):
174
175
""" Return the current cursor position.
175
176
"""
Original file line number Diff line number Diff line change @@ -86,7 +86,9 @@ def test_sessions_are_not_reused_if_still_in_use(self):
86
86
def test_can_run_simple_statement (self ):
87
87
session = GraphDatabase .driver ("bolt://localhost" ).session ()
88
88
count = 0
89
- for record in session .run ("RETURN 1 AS n" ).stream ():
89
+ cursor = session .run ("RETURN 1 AS n" )
90
+ assert cursor .position == - 1
91
+ for record in cursor .stream ():
90
92
assert record [0 ] == 1
91
93
assert record ["n" ] == 1
92
94
with self .assertRaises (KeyError ):
@@ -98,6 +100,7 @@ def test_can_run_simple_statement(self):
98
100
_ = record [object ()]
99
101
assert repr (record )
100
102
assert len (record ) == 1
103
+ assert cursor .position == count
101
104
count += 1
102
105
session .close ()
103
106
assert count == 1
You can’t perform that action at this time.
0 commit comments