MCPcopy Index your code
hub / github.com/davispuh/MySQL-for-Python-3 / test_rowcount

Method test_rowcount

tests/dbapi20.py:301–328  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

299 con.close()
300
301 def test_rowcount(self):
302 con = self._connect()
303 try:
304 cur = con.cursor()
305 self.executeDDL1(cur)
306 self.assertEqual(cur.rowcount,-1,
307 'cursor.rowcount should be -1 after executing no-result '
308 'statements'
309 )
310 cur.execute("insert into %sbooze values ('Victoria Bitter')" % (
311 self.table_prefix
312 ))
313 self.assertTrue(cur.rowcount in (-1,1),
314 'cursor.rowcount should == number or rows inserted, or '
315 'set to -1 after executing an insert statement'
316 )
317 cur.execute("select name from %sbooze" % self.table_prefix)
318 self.assertTrue(cur.rowcount in (-1,1),
319 'cursor.rowcount should == number of rows returned, or '
320 'set to -1 after executing a select statement'
321 )
322 self.executeDDL2(cur)
323 self.assertEqual(cur.rowcount,-1,
324 'cursor.rowcount not being reset to -1 after executing '
325 'no-result statements'
326 )
327 finally:
328 con.close()
329
330 lower_func = 'lower'
331 def test_callproc(self):

Callers

nothing calls this directly

Calls 6

_connectMethod · 0.95
executeDDL1Method · 0.95
executeDDL2Method · 0.95
cursorMethod · 0.80
executeMethod · 0.80
closeMethod · 0.80

Tested by

no test coverage detected