@@ -201,16 +201,16 @@ def test_1109_parse_password(self):
201
201
finally :
202
202
conn .changepassword (new_password , test_env .get_main_password ())
203
203
204
- def test_1112_exception_on_close (self ):
205
- "1112 - confirm an exception is raised after closing a connection"
204
+ def test_1110_exception_on_close (self ):
205
+ "1110 - confirm an exception is raised after closing a connection"
206
206
conn = test_env .get_connection ()
207
207
conn .close ()
208
208
self .assertRaisesRegex (oracledb .InterfaceError , "^DPY-1001:" ,
209
209
conn .rollback )
210
210
211
211
@unittest .skipIf (test_env .get_is_thin (), "not relevant for thin mode" )
212
- def test_1113_connect_with_handle (self ):
213
- "1113 - test creating a connection using a handle"
212
+ def test_1111_connect_with_handle (self ):
213
+ "1111 - test creating a connection using a handle"
214
214
conn = test_env .get_connection ()
215
215
cursor = conn .cursor ()
216
216
cursor .execute ("truncate table TestTempTable" )
@@ -229,13 +229,13 @@ def test_1113_connect_with_handle(self):
229
229
conn2 .close )
230
230
conn .close ()
231
231
232
- def test_1116_version (self ):
233
- "1116 - connection version is a string"
232
+ def test_1112_version (self ):
233
+ "1112 - connection version is a string"
234
234
conn = test_env .get_connection ()
235
235
self .assertIsInstance (conn .version , str )
236
236
237
- def test_1117_rollback_on_close (self ):
238
- "1117 - connection rolls back before close"
237
+ def test_1113_rollback_on_close (self ):
238
+ "1113 - connection rolls back before close"
239
239
conn = test_env .get_connection ()
240
240
cursor = conn .cursor ()
241
241
cursor .execute ("truncate table TestTempTable" )
@@ -248,8 +248,8 @@ def test_1117_rollback_on_close(self):
248
248
count , = cursor .fetchone ()
249
249
self .assertEqual (count , 0 )
250
250
251
- def test_1118_rollback_on_del (self ):
252
- "1118 - connection rolls back before destruction"
251
+ def test_1114_rollback_on_del (self ):
252
+ "1114 - connection rolls back before destruction"
253
253
conn = test_env .get_connection ()
254
254
cursor = conn .cursor ()
255
255
cursor .execute ("truncate table TestTempTable" )
@@ -262,8 +262,8 @@ def test_1118_rollback_on_del(self):
262
262
count , = cursor .fetchone ()
263
263
self .assertEqual (count , 0 )
264
264
265
- def test_1119_threading (self ):
266
- "1119 - multiple connections to database with multiple threads"
265
+ def test_1115_threading (self ):
266
+ "1115 - multiple connections to database with multiple threads"
267
267
threads = []
268
268
for i in range (20 ):
269
269
thread = threading .Thread (None , self .__connect_and_drop )
@@ -273,15 +273,15 @@ def test_1119_threading(self):
273
273
for thread in threads :
274
274
thread .join ()
275
275
276
- def test_1120_string_format (self ):
277
- "1120 - test string format of connection"
276
+ def test_1116_string_format (self ):
277
+ "1116 - test string format of connection"
278
278
conn = test_env .get_connection ()
279
279
expected_value = "<oracledb.Connection to %s@%s>" % \
280
280
(test_env .get_main_user (), test_env .get_connect_string ())
281
281
self .assertEqual (str (conn ), expected_value )
282
282
283
- def test_1121_ctx_mgr_close (self ):
284
- "1121 - test context manager - close"
283
+ def test_1117_ctx_mgr_close (self ):
284
+ "1117 - test context manager - close"
285
285
with test_env .get_connection () as conn :
286
286
cursor = conn .cursor ()
287
287
cursor .execute ("truncate table TestTempTable" )
@@ -296,8 +296,8 @@ def test_1121_ctx_mgr_close(self):
296
296
count , = cursor .fetchone ()
297
297
self .assertEqual (count , 1 )
298
298
299
- def test_1122_connection_attributes (self ):
300
- "1122 - test connection attribute values"
299
+ def test_1118_connection_attributes (self ):
300
+ "1118 - test connection attribute values"
301
301
conn = test_env .get_connection ()
302
302
if test_env .get_client_version () >= (12 , 1 ):
303
303
self .assertEqual (conn .ltxid , b'' )
@@ -314,8 +314,8 @@ def test_1122_connection_attributes(self):
314
314
self .assertRaises (TypeError , conn .stmtcachesize , 20.5 )
315
315
self .assertRaises (TypeError , conn .stmtcachesize , "value" )
316
316
317
- def test_1123_closed_connection_attributes (self ):
318
- "1123 - test closed connection attribute values"
317
+ def test_1119_closed_connection_attributes (self ):
318
+ "1119 - test closed connection attribute values"
319
319
conn = test_env .get_connection ()
320
320
conn .close ()
321
321
attr_names = ["current_schema" , "edition" , "external_name" ,
@@ -326,17 +326,17 @@ def test_1123_closed_connection_attributes(self):
326
326
self .assertRaisesRegex (oracledb .InterfaceError , "^DPY-1001:" ,
327
327
getattr , conn , name )
328
328
329
- def test_1124_ping (self ):
330
- "1124 - test connection ping makes a round trip"
329
+ def test_1120_ping (self ):
330
+ "1120 - test connection ping makes a round trip"
331
331
self .conn = test_env .get_connection ()
332
332
self .setup_round_trip_checker ()
333
333
self .conn .ping ()
334
334
self .assertRoundTrips (1 )
335
335
336
336
@unittest .skipIf (test_env .get_is_thin (),
337
337
"thin mode doesn't support two-phase commit yet" )
338
- def test_1125_transaction_begin (self ):
339
- "1125 - test begin, prepare, cancel transaction"
338
+ def test_1121_transaction_begin (self ):
339
+ "1121 - test begin, prepare, cancel transaction"
340
340
conn = test_env .get_connection ()
341
341
cursor = conn .cursor ()
342
342
cursor .execute ("truncate table TestTempTable" )
@@ -355,8 +355,8 @@ def test_1125_transaction_begin(self):
355
355
356
356
@unittest .skipIf (test_env .get_is_thin (),
357
357
"thin mode doesn't support two-phase commit yet" )
358
- def test_1126_multiple_transactions (self ):
359
- "1126 - test multiple transactions on the same connection"
358
+ def test_1122_multiple_transactions (self ):
359
+ "1122 - test multiple transactions on the same connection"
360
360
conn = test_env .get_connection ()
361
361
with conn .cursor () as cursor :
362
362
cursor .execute ("truncate table TestTempTable" )
@@ -389,8 +389,8 @@ def test_1126_multiple_transactions(self):
389
389
390
390
@unittest .skipIf (test_env .get_is_thin (),
391
391
"thin mode doesn't support two-phase commit yet" )
392
- def test_1127_multiple_global_transactions (self ):
393
- "1127 - test multiple global transactions on the same connection"
392
+ def test_1123_multiple_global_transactions (self ):
393
+ "1123 - test multiple global transactions on the same connection"
394
394
conn = test_env .get_connection ()
395
395
with conn .cursor () as cursor :
396
396
cursor .execute ("truncate table TestTempTable" )
@@ -434,8 +434,8 @@ def test_1127_multiple_global_transactions(self):
434
434
435
435
@unittest .skipIf (test_env .get_is_thin (),
436
436
"thin mode doesn't support two-phase commit yet" )
437
- def test_1128_exception_creating_global_txn_after_local_txn (self ):
438
- "1128 - test creating global txn after a local txn"
437
+ def test_1124_exception_creating_global_txn_after_local_txn (self ):
438
+ "1124 - test creating global txn after a local txn"
439
439
conn = test_env .get_connection ()
440
440
with conn .cursor () as cursor :
441
441
cursor .execute ("truncate table TestTempTable" )
@@ -450,8 +450,8 @@ def test_1128_exception_creating_global_txn_after_local_txn(self):
450
450
self .assertRaisesRegex (oracledb .DatabaseError , "^ORA-24776:" ,
451
451
conn .begin , * xid )
452
452
453
- def test_1129_threading_single_connection (self ):
454
- "1129 - single connection to database with multiple threads"
453
+ def test_1125_threading_single_connection (self ):
454
+ "1125 - single connection to database with multiple threads"
455
455
with test_env .get_connection () as conn :
456
456
threads = [threading .Thread (target = self .__verify_fetched_data ,
457
457
args = (conn ,)) for i in range (3 )]
@@ -460,8 +460,8 @@ def test_1129_threading_single_connection(self):
460
460
for t in threads :
461
461
t .join ()
462
462
463
- def test_1130_cancel (self ):
464
- "1130 - test connection cancel"
463
+ def test_1126_cancel (self ):
464
+ "1126 - test connection cancel"
465
465
conn = test_env .get_connection ()
466
466
sleep_proc_name = test_env .get_sleep_proc_name ()
467
467
def perform_cancel ():
@@ -480,8 +480,8 @@ def perform_cancel():
480
480
user , = cursor .fetchone ()
481
481
self .assertEqual (user , test_env .get_main_user ().upper ())
482
482
483
- def test_1131_change_password_during_connect (self ):
484
- "1131 - test changing password during connect"
483
+ def test_1127_change_password_during_connect (self ):
484
+ "1127 - test changing password during connect"
485
485
conn = test_env .get_connection ()
486
486
if self .is_on_oracle_cloud (conn ):
487
487
self .skipTest ("passwords on Oracle Cloud are strictly controlled" )
@@ -492,8 +492,8 @@ def test_1131_change_password_during_connect(self):
492
492
conn = test_env .get_connection (password = new_password )
493
493
conn .changepassword (new_password , test_env .get_main_password ())
494
494
495
- def test_1132_autocommit_during_reexecute (self ):
496
- "1132 - test use of autocommit during reexecute"
495
+ def test_1128_autocommit_during_reexecute (self ):
496
+ "1128 - test use of autocommit during reexecute"
497
497
sql = "insert into TestTempTable (IntCol, StringCol1) values (:1, :2)"
498
498
data_to_insert = [
499
499
(1 , "Test String #1" ),
@@ -512,8 +512,8 @@ def test_1132_autocommit_during_reexecute(self):
512
512
other_cursor .execute ("select IntCol, StringCol1 from TestTempTable" )
513
513
self .assertEqual (other_cursor .fetchall (), data_to_insert )
514
514
515
- def test_1133_current_schema (self ):
516
- "1133 - test current_schema is set properly"
515
+ def test_1129_current_schema (self ):
516
+ "1129 - test current_schema is set properly"
517
517
conn = test_env .get_connection ()
518
518
self .assertIsNone (conn .current_schema )
519
519
@@ -532,8 +532,8 @@ def test_1133_current_schema(self):
532
532
result , = cursor .fetchone ()
533
533
self .assertEqual (result , user )
534
534
535
- def test_1134_dbms_output (self ):
536
- "1134 - test dbms_output package"
535
+ def test_1130_dbms_output (self ):
536
+ "1130 - test dbms_output package"
537
537
conn = test_env .get_connection ()
538
538
cursor = conn .cursor ()
539
539
test_string = "Testing DBMS_OUTPUT package"
@@ -550,32 +550,32 @@ def test_1134_dbms_output(self):
550
550
@unittest .skipIf (not test_env .get_is_thin () and \
551
551
test_env .get_client_version () < (18 , 1 ),
552
552
"unsupported client" )
553
- def test_1135_calltimeout (self ):
554
- "1135 - test connection call_timeout"
553
+ def test_1131_calltimeout (self ):
554
+ "1131 - test connection call_timeout"
555
555
conn = test_env .get_connection ()
556
556
conn .call_timeout = 500 # milliseconds
557
557
self .assertEqual (conn .call_timeout , 500 )
558
558
self .assertRaisesRegex (oracledb .DatabaseError , "^DPY-4011:|^DPY-4024:" ,
559
559
conn .cursor ().callproc ,
560
560
test_env .get_sleep_proc_name (), [2 ])
561
561
562
- def test_1137_connection_repr (self ):
563
- "1137 - test Connection repr()"
562
+ def test_1132_connection_repr (self ):
563
+ "1132 - test Connection repr()"
564
564
class MyConnection (oracledb .Connection ):
565
565
pass
566
566
conn = test_env .get_connection (conn_class = MyConnection )
567
- expected_regex = f"^ <{ __name__ } .TestCase.test_1137_connection_repr ." \
567
+ expected_value = f"<{ __name__ } .TestCase.test_1132_connection_repr ." \
568
568
f"<locals>.MyConnection to { conn .username } @" \
569
- f"{ conn .dsn } >$ "
570
- self .assertRegex (repr (conn ), expected_regex )
569
+ f"{ conn .dsn } >"
570
+ self .assertEqual (repr (conn ), expected_value )
571
571
572
- expected_regex = f"^<{ __name__ } .TestCase.test_1137_connection_repr." \
573
- "<locals>.MyConnection disconnected>$"
574
572
conn .close ()
575
- self .assertRegex (repr (conn ), expected_regex )
573
+ expected_value = f"<{ __name__ } .TestCase.test_1132_connection_repr." \
574
+ "<locals>.MyConnection disconnected>"
575
+ self .assertEqual (repr (conn ), expected_value )
576
576
577
- def test_1138_get_write_only_attributes (self ):
578
- "1138 - test getting write-only attributes"
577
+ def test_1133_get_write_only_attributes (self ):
578
+ "1133 - test getting write-only attributes"
579
579
conn = test_env .get_connection ()
580
580
with self .assertRaises (AttributeError ):
581
581
conn .action
@@ -590,8 +590,8 @@ def test_1138_get_write_only_attributes(self):
590
590
with self .assertRaises (AttributeError ):
591
591
conn .client_identifier
592
592
593
- def test_1139_invalid_params (self ):
594
- "1139 - test error for invalid type for params and pool"
593
+ def test_1134_invalid_params (self ):
594
+ "1134 - test error for invalid type for params and pool"
595
595
pool = test_env .get_pool ()
596
596
pool .close ()
597
597
self .assertRaisesRegex (oracledb .InterfaceError , "^DPY-1002:" ,
@@ -601,8 +601,8 @@ def test_1139_invalid_params(self):
601
601
self .assertRaisesRegex (oracledb .ProgrammingError , "^DPY-2025:" ,
602
602
oracledb .connect , params = {"number" : 7 })
603
603
604
- def test_1140_instance_name (self ):
605
- "1140 - test connection instance name"
604
+ def test_1135_instance_name (self ):
605
+ "1135 - test connection instance name"
606
606
conn = test_env .get_connection ()
607
607
cursor = conn .cursor ()
608
608
cursor .execute ("""
@@ -611,8 +611,8 @@ def test_1140_instance_name(self):
611
611
instance_name , = cursor .fetchone ()
612
612
self .assertEqual (conn .instance_name .upper (), instance_name )
613
613
614
- def test_1141_deprecations (self ):
615
- "1141 - test deprecated attributes"
614
+ def test_1136_deprecations (self ):
615
+ "1136 - test deprecated attributes"
616
616
conn = test_env .get_connection ()
617
617
conn .callTimeout = 500
618
618
self .assertEqual (conn .callTimeout , 500 )
@@ -624,8 +624,8 @@ def test_1141_deprecations(self):
624
624
@unittest .skipIf (test_env .get_server_version () < (23 , 0 ) or \
625
625
test_env .get_client_version () < (23 , 0 ),
626
626
"unsupported client/server" )
627
- def test_1142_max_length_password (self ):
628
- "1142 - test maximum allowed length for password"
627
+ def test_1137_max_length_password (self ):
628
+ "1137 - test maximum allowed length for password"
629
629
conn = test_env .get_connection ()
630
630
if self .is_on_oracle_cloud (conn ):
631
631
self .skipTest ("passwords on Oracle Cloud are strictly controlled" )
0 commit comments