From 73155245bb547997d4d992ddb185fcf672ff2d2c Mon Sep 17 00:00:00 2001 From: Anthony Tuininga Date: Mon, 22 May 2023 17:17:18 -0600 Subject: [PATCH] Additional tests. --- tests/test_3300_soda_database.py | 4 +++- tests/test_3400_soda_collection.py | 14 +++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/test_3300_soda_database.py b/tests/test_3300_soda_database.py index 2ef8f0f..abe74db 100644 --- a/tests/test_3300_soda_database.py +++ b/tests/test_3300_soda_database.py @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# Copyright (c) 2020, 2022, Oracle and/or its affiliates. +# Copyright (c) 2020, 2023, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -126,6 +126,8 @@ class TestCase(test_env.BaseTestCase): self.assertRaises(TypeError, soda_db.createCollection, 1) self.assertRaisesRegex(oracledb.DatabaseError, "^ORA-40658:", soda_db.createCollection, None) + self.assertRaisesRegex(oracledb.DatabaseError, "^ORA-40675:", + soda_db.createCollection, "CollMetadata", 7) self.assertRaises(TypeError, soda_db.getCollectionNames, 1) if __name__ == "__main__": diff --git a/tests/test_3400_soda_collection.py b/tests/test_3400_soda_collection.py index d039369..5add724 100644 --- a/tests/test_3400_soda_collection.py +++ b/tests/test_3400_soda_collection.py @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# Copyright (c) 2020, 2022, Oracle and/or its affiliates. +# Copyright (c) 2020, 2023, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -549,5 +549,17 @@ class TestCase(test_env.BaseTestCase): soda_db.createCollection, "TestSodaMapNonExistent", mapMode=True) + def test_3427_negative(self): + "3427 - test negative cases for SodaOperation methods" + soda_db = self.get_soda_database() + coll = soda_db.createCollection("TestSodaOperationNegative") + self.assertRaises(TypeError, coll.find().filter, 5) + self.assertRaises(TypeError, coll.find().key, 2) + self.assertRaises(TypeError, coll.find().keys, [1, 2, 3]) + self.assertRaises(TypeError, coll.find().skip, "word") + self.assertRaises(TypeError, coll.find().skip, -5) + self.assertRaises(TypeError, coll.find().version, 1971) + self.assertRaises(TypeError, coll.find().limit, "a word") + if __name__ == "__main__": test_env.run_test_cases()