Exemplo 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')
Exemplo n.º 2
0
def test_load_twice(db, data_directory):
    with pytest.raises((ValueError, IntegrityError)):
        load_from_directory(db, data_directory)
Exemplo n.º 3
0
def test_load_twice(db, data_directory):
    with pytest.raises((ValueError, IntegrityError)):
        load_from_directory(db, data_directory)