Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support async bulk api #90

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
update test
RainJayTsai committed Apr 7, 2018
commit 4ecef47ccb2ce4d02108fea3b17c0d34266196a9
7 changes: 3 additions & 4 deletions tests/test_bulk.py
Original file line number Diff line number Diff line change
@@ -29,24 +29,23 @@ def gen_data2():
@pytest.mark.run_loop
async def test_bulk_simple(es):
success, fails = await bulk(es, gen_data1(),
concurrency_limit=2,
stats_only=True)
assert success == 10
assert fails == 0

success, fails = await bulk(es, gen_data2(),
concurrency_limit=2,
stats_only=True)
assert success == 10
assert fails == 0


@pytest.mark.run_loop
async def test_bulk_fails(es):
datas = [{'op_type': 'delete',
datas = [{'_op_type': 'delete',
'_index': 'test_aioes',
'_type': 'type_3', '_id': "999"}
]

success, fails = await bulk(es, datas, stats_only=True)
assert success == 0
assert success == 1
assert fails == 1