~amirouche/asyncio-foundationdb

a612c94764f2dc1857e78e92df86511afd7837b8 — Amirouche 1 year, 6 months ago 503e57d v0.11.0
tests: pstore: remove the use of processus pool...

... the large diff is due to indentation change, only one line was
deleted.
1 files changed, 29 insertions(+), 30 deletions(-)

M tests.py
M tests.py => tests.py +29 -30
@@ 549,33 549,32 @@ async def test_peace_search_store():

    db = await open()

    with futures.ProcessPoolExecutor(max_workers=multiprocessing.cpu_count()) as pool:
        store = pstore.make('test-pstore', (42,), pool)

        DOC0 = dict(
            foundationdb=1,
            okvs=2,
            database=42,
        )
        DOC1 = dict(
            sqlite=1,
            sql=2,
            database=3
        )
        DOC2 = dict(
            spam=42,
        )
        for uid, doc in enumerate((DOC0, DOC1, DOC2)):
            await found.transactional(db, pstore.index, store, uid, doc)

        expected = [(0, 1)]
        out = await found.transactional(db, pstore.search, store, ["foundationdb"], 10)
        assert out == expected

        expected = [(2, 42)]
        out = await found.transactional(db, pstore.search, store, ["spam"], 10)
        assert out == expected

        expected = [(0, 42), (1, 3)]
        out = await found.transactional(db, pstore.search, store, ["database"], 10)
        assert out == expected
    store = pstore.make('test-pstore', (42,))

    DOC0 = dict(
        foundationdb=1,
        okvs=2,
        database=42,
    )
    DOC1 = dict(
        sqlite=1,
        sql=2,
        database=3
    )
    DOC2 = dict(
        spam=42,
    )
    for uid, doc in enumerate((DOC0, DOC1, DOC2)):
        await found.transactional(db, pstore.index, store, uid, doc)

    expected = [(0, 1)]
    out = await found.transactional(db, pstore.search, store, ["foundationdb"], 10)
    assert out == expected

    expected = [(2, 42)]
    out = await found.transactional(db, pstore.search, store, ["spam"], 10)
    assert out == expected

    expected = [(0, 42), (1, 3)]
    out = await found.transactional(db, pstore.search, store, ["database"], 10)
    assert out == expected