Skip to content

Commit 51bf65f

Browse files
Test improvements.
1 parent ebe22f3 commit 51bf65f

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/test_3000_subscription.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,5 +254,26 @@ def test_3005_registerquery_negative(self):
254254
sub.registerquery, "select * from Nonexistent")
255255
connection.unsubscribe(sub)
256256

257+
@unittest.skipIf(test_env.get_client_version() < (23, 1),
258+
"crashes in older clients")
259+
def test_3006_attributes(self):
260+
"3006 - test getting subscription attributes"
261+
data = DMLSubscriptionData(1)
262+
connection = test_env.get_connection(events=True)
263+
cursor = connection.cursor()
264+
args = dict(callback=data.callback_handler, ip_address=None, port=0,
265+
name="Sub1", namespace=oracledb.SUBSCR_NAMESPACE_DBCHANGE,
266+
timeout=10, protocol=oracledb.SUBSCR_PROTO_OCI,
267+
qos=oracledb.SUBSCR_QOS_QUERY,
268+
operations=oracledb.OPCODE_INSERT)
269+
sub = connection.subscribe(**args)
270+
for attr_name in args:
271+
self.assertEqual(getattr(sub, attr_name), args[attr_name])
272+
self.assertEqual(sub.connection, connection)
273+
cursor.execute("select REGID from USER_CHANGE_NOTIFICATION_REGS")
274+
self.assertEqual(sub.id, cursor.fetchone()[0])
275+
connection.unsubscribe(sub)
276+
connection.close()
277+
257278
if __name__ == "__main__":
258279
test_env.run_test_cases()

0 commit comments

Comments
 (0)