示例#1
0
 def test_copy_table(self):
     db_dump.add_dump_entry(datetime.today().strftime('%s'))
     with db.engine.connect() as connection:
         db_dump.copy_table(
             cursor=connection.connection.cursor(),
             location=self.tempdir,
             columns='id, created',
             table_name='data_dump',
         )
     dumps = db_dump.get_dump_entries()
     with open(os.path.join(self.tempdir, 'data_dump'), 'r') as f:
         file_contents = [line for line in f]
     self.assertEqual(len(dumps), len(file_contents))
 def test_copy_table(self):
     db_dump.add_dump_entry(datetime.today().strftime('%s'))
     with db.engine.connect() as connection:
         db_dump.copy_table(
             cursor=connection.connection.cursor(),
             location=self.tempdir,
             columns='id, created',
             table_name='data_dump',
         )
     dumps = db_dump.get_dump_entries()
     with open(os.path.join(self.tempdir, 'data_dump'), 'r') as f:
         file_contents = [line for line in f]
     self.assertEqual(len(dumps), len(file_contents))