@@ -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+
257278if __name__ == "__main__" :
258279 test_env .run_test_cases ()
0 commit comments