Esempio n. 1
0
def db_reload(datadir):
    for table in reversed(tables.metadata.sorted_tables):
        print('Deleting {}'.format(table))
        db.session.execute(table.delete())
    print('Loading database from {}'.format(datadir))
    load_from_directory(db.session, datadir)
    print('Database loaded')
Esempio n. 2
0
def test_load_twice(db, data_directory):
    with pytest.raises((ValueError, IntegrityError)):
        load_from_directory(db, data_directory)
Esempio n. 3
0
def test_load_twice(db, data_directory):
    with pytest.raises((ValueError, IntegrityError)):
        load_from_directory(db, data_directory)