def test_import_db_dump(self):
     id1 = dump._create_new_inc_dump_record()[0]
     path = dump.dump_db(self.temp_dir)
     self.reset_db()
     dump.import_db_dump(path, _TABLES)
     self.assertEqual(dump.list_incremental_dumps()[0][0], id1)
     id2 = dump._create_new_inc_dump_record()[0]
     self.assertGreater(id2, id1)
Exemplo n.º 2
0
def incremental_info(all=False):
    """Prints information about incremental dumps: id, timestamp.

    By default outputs information for the latest dump.
    """
    info = dump.list_incremental_dumps()
    if info:
        if all:
            print('Incremental dumps:')
            for current in info:
                print(' - %s at %s' % current)
        else:
            print('Last dump ID: %s\nTimestamp: %s' % info[0])
    else:
        print('No incremental dumps yet.')
def incremental_info(all=False):
    """Prints information about incremental dumps: id, timestamp.

    By default outputs information for the latest dump.
    """
    info = dump.list_incremental_dumps()
    if info:
        if all:
            print('Incremental dumps:')
            for current in info:
                print(' - %s at %s' % current)
        else:
            print('Last dump ID: %s\nTimestamp: %s' % info[0])
    else:
        print('No incremental dumps yet.')
Exemplo n.º 4
0
def incremental_info(all=False):
    db.init_db_engine(config.SQLALCHEMY_DATABASE_URI)
    """Prints information about incremental dumps: id, timestamp.

    By default outputs information for the latest dump.
    """
    info = dump.list_incremental_dumps()
    if info:
        if all:
            print('Incremental dumps:')
            for current in info:
                print(' - %s at %s' % current)
        else:
            print('Last dump ID: %s\nTimestamp: %s' % info[0])
    else:
        print('No incremental dumps yet.')
Exemplo n.º 5
0
def incremental_info(all=False):
    """Prints information about incremental dumps: id, timestamp.

    By default outputs information for the latest dump.
    """
    current_app.logger.info("Incremental dumps are disabled")
    return
    info = dump.list_incremental_dumps()
    if info:
        if all:
            current_app.logger.info('Incremental dumps:')
            for current in info:
                current_app.logger.info(' - %s at %s' % current)
        else:
            current_app.logger.info('Last dump ID: %s\nTimestamp: %s' %
                                    info[0])
    else:
        current_app.logger.info('No incremental dumps yet.')
Exemplo n.º 6
0
 def test_get_last_inc_dump_info(self):
     dump_id, dump_time = dump._create_new_inc_dump_record()
     self.assertEqual(dump.list_incremental_dumps()[0][1], dump_time)
Exemplo n.º 7
0
 def test_get_last_inc_dump_info(self):
     dump_id, dump_time = dump._create_new_inc_dump_record()
     self.assertEqual(dump.list_incremental_dumps()[0][1], dump_time)