Exemple #1
0
def check_parallel_import(loadercls):
    loader = loadercls(client, "save")
    files = toolbox.splitter(csvfile_with_header(), 1)
    files2 = toolbox.splitter(csvfile_no_header(), 1)
    with core.ScratchDB("config://scratch/psycopg2_uri", _util.create) as db:
        runner = core.Runner(db.conn)
        runner.pmap(loader, files)
        runner.pmap(loader, files2)
        print(runner(sql.select(client)))
Exemple #2
0
def test_splitter():
    lines = [c.read() for c in toolbox.splitter(csvfile_with_header(), 1)]
    assert_equal(lines, ["michele,A good customer,something\n", "andrea,A bad customer,something\n", ""])