def testDelPush(self): pusher = Pusher(TestConf) pusher.pushDelData(self.data) cursor = self.conn.cursor() cursor.execute('SELECT * FROM ' + TestConf.dstDelTable) rows = cursor.fetchall() self.assertEqual(3, len(rows))
def transmitDelData(self, dumpType): exporter = Exporter(self.conf) pusher = Pusher(self.conf) if dumpType == SqlReader.FULL: sql = self.sqlReader.getDelSql() elif dumpType == SqlReader.INCR: sql = self.sqlReader.getDelIncSql() exporter.execute(sql) subResult = exporter.fetchmany() while subResult: pusher.pushDelData(subResult) subResult = exporter.fetchmany() exporter.close() pusher.close()