(self)
| 359 | self.assertEqual(sorted(data), sorted(result)) |
| 360 | |
| 361 | def test_bulk_insert(self): |
| 362 | conn = self.connect() |
| 363 | cursor = conn.cursor() |
| 364 | |
| 365 | data = [(0, "bob", 21, 123), (1, "jim", 56, 45), (2, "fred", 100, 180)] |
| 366 | cursor.executemany( |
| 367 | "insert into bulkinsert (id, name, age, height) values (%s,%s,%s,%s)", |
| 368 | data, |
| 369 | ) |
| 370 | self.assertEqual( |
| 371 | cursor._executed, |
| 372 | bytearray( |
| 373 | b"insert into bulkinsert (id, name, age, height) values " |
| 374 | b"(0,'bob',21,123),(1,'jim',56,45),(2,'fred',100,180)" |
| 375 | ), |
| 376 | ) |
| 377 | cursor.execute("commit") |
| 378 | self._verify_records(data) |
| 379 | |
| 380 | def test_bulk_insert_multiline_statement(self): |
| 381 | conn = self.connect() |
nothing calls this directly
no test coverage detected