Skip to content

Commit

Permalink
Update test_async_batch.py
Browse files Browse the repository at this point in the history
Rearrange test case to highlight parallel batch uses
  • Loading branch information
thipoktham authored Oct 10, 2024
1 parent 045414b commit 6b7dd3e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/test_async_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,18 @@ async def test_batch_commit_multiple(self):
doc_ref_data_2 = [(coll_ref.document(key), datum) for (key, datum) in data_2]

batch_1 = fs.batch()
batch_2 = fs.batch()
batch_3 = fs.batch()

for doc_ref, datum in doc_ref_data_1:
batch_1.set(doc_ref, datum)
batch_1.delete(coll_ref.document("sample"))
await batch_1.commit()

batch_2 = fs.batch()
for doc_ref, datum in doc_ref_data_2:
batch_2.set(doc_ref, datum)
batch_2.delete(coll_ref.document("quux"))
batch_3.delete(coll_ref.document("foo"))

await batch_1.commit()
await batch_2.commit()

assert fs._data == {
Expand Down

0 comments on commit 6b7dd3e

Please sign in to comment.