Example #1
0
 def test_1_vals_3(self):
     self.fill_vals(self.src)
     dumpspec = (('id', deltadump.INTEGER, -1),)
     deltadump.dump_table(table='test', order='id', columns=dumpspec,
                          db=self.src, fh=self.fh)
     self.fh.seek(0)
     deltadump.load_table(table='test', columns=dumpspec, db=self.dst,
                          fh=self.fh)
     self.compare_tables(self.src, self.dst)
Example #2
0
 def test_1_vals_3(self):
     self.fill_vals(self.src)
     dumpspec = (('id', deltadump.INTEGER, -1),)
     deltadump.dump_table(table='test', order='id', columns=dumpspec,
                          db=self.src, fh=self.fh)
     self.fh.seek(0)
     deltadump.load_table(table='test', columns=dumpspec, db=self.dst,
                          fh=self.fh)
     self.compare_tables(self.src, self.dst)
Example #3
0
 def test_2_buf_auto(self):
     self.fill_vals(self.src)
     self.fill_buf(self.src)
     dumpspec = (('id', deltadump.INTEGER),
                 ('buf', deltadump.BLOB))
     deltadump.dump_table(table='test', order='id', columns=dumpspec,
                          db=self.src, fh=self.fh)
     self.fh.seek(0)
     deltadump.load_table(table='test', columns=dumpspec, db=self.dst,
                          fh=self.fh)
     self.compare_tables(self.src, self.dst)
Example #4
0
    def test_transactions(self):
        self.fill_vals(self.src)
        dumpspec = (('id', deltadump.INTEGER, 0),)
        deltadump.dump_table(table='test', order='id', columns=dumpspec,
                             db=self.src, fh=self.fh)
        self.fh.seek(0)
        self.dst.execute('PRAGMA journal_mode = WAL')

        deltadump.load_table(table='test', columns=dumpspec, db=self.dst,
                             fh=self.fh, trx_rows=10)
        self.compare_tables(self.src, self.dst)
Example #5
0
 def test_2_buf_auto(self):
     self.fill_vals(self.src)
     self.fill_buf(self.src)
     dumpspec = (('id', deltadump.INTEGER),
                 ('buf', deltadump.BLOB))
     deltadump.dump_table(table='test', order='id', columns=dumpspec,
                          db=self.src, fh=self.fh)
     self.fh.seek(0)
     deltadump.load_table(table='test', columns=dumpspec, db=self.dst,
                          fh=self.fh)
     self.compare_tables(self.src, self.dst)
Example #6
0
    def test_transactions(self):
        self.fill_vals(self.src)
        dumpspec = (('id', deltadump.INTEGER, 0),)
        deltadump.dump_table(table='test', order='id', columns=dumpspec,
                             db=self.src, fh=self.fh)
        self.fh.seek(0)
        self.dst.execute('PRAGMA journal_mode = WAL')

        deltadump.load_table(table='test', columns=dumpspec, db=self.dst,
                             fh=self.fh, trx_rows=10)
        self.compare_tables(self.src, self.dst)
Example #7
0
 def test_5_multi(self):
     self.fill_vals(self.src)
     dumpspec = (('id', deltadump.INTEGER, 0),)
     deltadump.dump_table(table='test', order='id', columns=dumpspec,
                          db=self.src, fh=self.fh)
     deltadump.dump_table(table='test', order='id', columns=dumpspec,
                          db=self.src, fh=self.fh)
     self.fh.seek(0)
     deltadump.load_table(table='test', columns=dumpspec, db=self.dst,
                          fh=self.fh)
     self.dst.execute('DELETE FROM test')
     deltadump.load_table(table='test', columns=dumpspec, db=self.dst,
                          fh=self.fh)
     self.compare_tables(self.src, self.dst)
Example #8
0
 def test_5_multi(self):
     self.fill_vals(self.src)
     dumpspec = (('id', deltadump.INTEGER, 0),)
     deltadump.dump_table(table='test', order='id', columns=dumpspec,
                          db=self.src, fh=self.fh)
     deltadump.dump_table(table='test', order='id', columns=dumpspec,
                          db=self.src, fh=self.fh)
     self.fh.seek(0)
     deltadump.load_table(table='test', columns=dumpspec, db=self.dst,
                          fh=self.fh)
     self.dst.execute('DELETE FROM test')
     deltadump.load_table(table='test', columns=dumpspec, db=self.dst,
                          fh=self.fh)
     self.compare_tables(self.src, self.dst)
Example #9
0
    def test_4_time(self):
        self.fill_vals(self.src)

        t1 = 0.5 * time.time()
        t2 = 2 * time.time()
        for (id_,) in self.src.query('SELECT id FROM test'):
            val = random.uniform(t1, t2)
            self.src.execute('UPDATE test SET buf=? WHERE id=?', (val, id_))

        dumpspec = (('id', deltadump.INTEGER),
                    ('buf', deltadump.TIME))

        deltadump.dump_table(table='test', order='id', columns=dumpspec,
                             db=self.src, fh=self.fh)
        self.fh.seek(0)
        deltadump.load_table(table='test', columns=dumpspec, db=self.dst,
                             fh=self.fh)

        self.compare_tables(self.src, self.dst)
Example #10
0
    def test_4_time(self):
        self.fill_vals(self.src)

        t1 = 0.5 * time.time()
        t2 = 2 * time.time()
        for (id_,) in self.src.query('SELECT id FROM test'):
            val = random.uniform(t1, t2)
            self.src.execute('UPDATE test SET buf=? WHERE id=?', (val, id_))

        dumpspec = (('id', deltadump.INTEGER),
                    ('buf', deltadump.TIME))

        deltadump.dump_table(table='test', order='id', columns=dumpspec,
                             db=self.src, fh=self.fh)
        self.fh.seek(0)
        deltadump.load_table(table='test', columns=dumpspec, db=self.dst,
                             fh=self.fh)

        self.compare_tables(self.src, self.dst)