@@ -62,11 +62,10 @@ def test_property_description(self):
62
62
self .assertIsInstance (cursor .description [0 ], ColumnInfo )
63
63
64
64
def test_property_rowcount (self ):
65
- from google .cloud .spanner_dbapi .cursor import _UNSET_COUNT
66
-
67
65
connection = self ._make_connection (self .INSTANCE , self .DATABASE )
68
66
cursor = self ._make_one (connection )
69
- self .assertEqual (cursor .rowcount , _UNSET_COUNT )
67
+ with self .assertRaises (NotImplementedError ):
68
+ cursor .rowcount
70
69
71
70
def test_callproc (self ):
72
71
from google .cloud .spanner_dbapi .exceptions import InterfaceError
@@ -94,26 +93,25 @@ def test_close(self, mock_client):
94
93
cursor .execute ("SELECT * FROM database" )
95
94
96
95
def test_do_execute_update (self ):
97
- from google .cloud .spanner_dbapi .cursor import _UNSET_COUNT
96
+ from google .cloud .spanner_dbapi .checksum import ResultsChecksum
98
97
99
98
connection = self ._make_connection (self .INSTANCE , self .DATABASE )
100
99
cursor = self ._make_one (connection )
100
+ cursor ._checksum = ResultsChecksum ()
101
101
transaction = mock .MagicMock ()
102
102
103
103
def run_helper (ret_value ):
104
104
transaction .execute_update .return_value = ret_value
105
- res = cursor ._do_execute_update (
105
+ cursor ._do_execute_update (
106
106
transaction = transaction , sql = "SELECT * WHERE true" , params = {},
107
107
)
108
- return res
108
+ return cursor . fetchall ()
109
109
110
110
expected = "good"
111
- self .assertEqual (run_helper (expected ), expected )
112
- self .assertEqual (cursor ._row_count , _UNSET_COUNT )
111
+ self .assertEqual (run_helper (expected ), [expected ])
113
112
114
113
expected = 1234
115
- self .assertEqual (run_helper (expected ), expected )
116
- self .assertEqual (cursor ._row_count , expected )
114
+ self .assertEqual (run_helper (expected ), [expected ])
117
115
118
116
def test_execute_programming_error (self ):
119
117
from google .cloud .spanner_dbapi .exceptions import ProgrammingError
@@ -706,7 +704,6 @@ def test_setoutputsize(self):
706
704
707
705
def test_handle_dql (self ):
708
706
from google .cloud .spanner_dbapi import utils
709
- from google .cloud .spanner_dbapi .cursor import _UNSET_COUNT
710
707
711
708
connection = self ._make_connection (self .INSTANCE , mock .MagicMock ())
712
709
connection .database .snapshot .return_value .__enter__ .return_value = (
@@ -718,7 +715,6 @@ def test_handle_dql(self):
718
715
cursor ._handle_DQL ("sql" , params = None )
719
716
self .assertEqual (cursor ._result_set , ["0" ])
720
717
self .assertIsInstance (cursor ._itr , utils .PeekIterator )
721
- self .assertEqual (cursor ._row_count , _UNSET_COUNT )
722
718
723
719
def test_context (self ):
724
720
connection = self ._make_connection (self .INSTANCE , self .DATABASE )
0 commit comments