Skip to content

Commit 0a59085

Browse files
Additional test cases.
1 parent 512826e commit 0a59085

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

doc/src/release_notes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Common Changes
3232
#) Enhanced type checking
3333
(`issue 54 <https://github.com/oracle/python-oracledb/issues/54>`__),
3434
(`issue 60 <https://github.com/oracle/python-oracledb/issues/60>`__).
35+
#) Improved test suite and documentation.
3536

3637

3738
oracledb 1.1.0 (September 2022)

tests/test_3400_soda_collection.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,5 +468,24 @@ def test_3420_save_and_get(self):
468468
self.assertEqual(doc.getContent(), fetched_doc.getContent())
469469
coll.drop()
470470

471+
def test_3421_insert_many_and_get(self):
472+
"3421 - test insert many and get"
473+
soda_db = self.get_soda_database(minclient=(18, 5))
474+
coll = soda_db.createCollection("TestInsertManyAndGet")
475+
values_to_insert = [
476+
dict(name="George", age=25),
477+
soda_db.createDocument(dict(name="Lucas", age=47))
478+
]
479+
docs = coll.insertManyAndGet(values_to_insert)
480+
inserted_keys = [i.key for i in docs]
481+
self.connection.commit()
482+
self.assertEqual(coll.find().count(), len(values_to_insert))
483+
for key, expected_doc in zip(inserted_keys, values_to_insert):
484+
if isinstance(expected_doc, dict):
485+
expected_doc = soda_db.createDocument(expected_doc)
486+
doc = coll.find().key(key).getOne()
487+
self.assertEqual(doc.getContent(), expected_doc.getContent())
488+
coll.drop()
489+
471490
if __name__ == "__main__":
472491
test_env.run_test_cases()

0 commit comments

Comments
 (0)