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