@@ -90,8 +90,10 @@ def test_7203(self):
9090 f .write ("some garbage data which is not a valid entry\n " )
9191 f .write (f"{ network_service_name } = { connect_string } \n " )
9292 params = oracledb .ConnectParams (config_dir = temp_dir )
93- with self .assertRaisesFullCode ("DPY-4032" ):
94- params .parse_connect_string (network_service_name )
93+ params .parse_connect_string (network_service_name )
94+ self .assertEqual (params .host , host )
95+ self .assertEqual (params .port , port )
96+ self .assertEqual (params .service_name , service_name )
9597
9698 def test_7204 (self ):
9799 "7204 - test tnsnames.ora with multiple aliases on one line"
@@ -308,20 +310,25 @@ def test_7212(self):
308310
309311 def test_7213 (self ):
310312 "7213 - duplicate entry in same file, but different connect strings"
311- host = "host_7213 "
313+ host_a = "host_7213a "
312314 port = 7213
313- service_name = "service_7213"
314- connect_string = f"{ host } :{ port } /{ service_name } "
315+ service_name_a = "service_7213a"
316+ host_b = "host_7213b"
317+ service_name_b = "service_7213b"
318+ connect_string_a = f"{ host_a } :{ port } /{ service_name_a } "
319+ connect_string_b = f"{ host_b } :{ port } /{ service_name_b } "
315320 network_service_name = "nsn_7213"
316321 with tempfile .TemporaryDirectory () as temp_dir :
317322 file_name = os .path .join (temp_dir , "tnsnames.ora" )
318323 with open (file_name , "w" ) as f :
319- f .write (f"{ network_service_name } = { connect_string } \n " )
324+ f .write (f"{ network_service_name } = { connect_string_a } \n " )
320325 f .write ("some_other_nsn = some_host/some_service\n " )
321- f .write (f"{ network_service_name } = x { connect_string } \n " )
326+ f .write (f"{ network_service_name } = { connect_string_b } \n " )
322327 params = oracledb .ConnectParams (config_dir = temp_dir )
323- with self .assertRaisesFullCode ("DPY-4031" ):
324- params .parse_connect_string (network_service_name )
328+ params .parse_connect_string (network_service_name )
329+ self .assertEqual (params .host , host_b )
330+ self .assertEqual (params .port , port )
331+ self .assertEqual (params .service_name , service_name_b )
325332
326333 def test_7214 (self ):
327334 "7214 - duplicate entry in other file, but identical connect strings"
@@ -346,24 +353,29 @@ def test_7214(self):
346353 self .assertEqual (params .service_name , service_name )
347354
348355 def test_7215 (self ):
349- "7215 - duplicate entry in other file, but identical connect strings"
350- host = "host_7215 "
356+ "7215 - duplicate entry in other file, but different connect strings"
357+ host_a = "host_7215a "
351358 port = 7215
352- service_name = "service_7215"
353- connect_string = f"{ host } :{ port } /{ service_name } "
359+ service_name_a = "service_7215a"
360+ host_b = "host_7215b"
361+ service_name_b = "service_7215b"
362+ connect_string_a = f"{ host_a } :{ port } /{ service_name_a } "
363+ connect_string_b = f"{ host_b } :{ port } /{ service_name_b } "
354364 network_service_name = "nsn_7215"
355365 include_name = "inc_7215.ora"
356366 with tempfile .TemporaryDirectory () as temp_dir :
357367 file_name = os .path .join (temp_dir , "tnsnames.ora" )
358368 include_file_name = os .path .join (temp_dir , include_name )
359369 with open (file_name , "w" ) as f :
360- f .write (f"{ network_service_name } = { connect_string } \n " )
370+ f .write (f"{ network_service_name } = { connect_string_a } \n " )
361371 f .write (f"IFILE = { include_name } " )
362372 with open (include_file_name , "w" ) as f :
363- f .write (f"{ network_service_name } = x { connect_string } \n " )
373+ f .write (f"{ network_service_name } = { connect_string_b } \n " )
364374 params = oracledb .ConnectParams (config_dir = temp_dir )
365- with self .assertRaisesFullCode ("DPY-4031" ):
366- params .parse_connect_string (network_service_name )
375+ params .parse_connect_string (network_service_name )
376+ self .assertEqual (params .host , host_b )
377+ self .assertEqual (params .port , port )
378+ self .assertEqual (params .service_name , service_name_b )
367379
368380 def test_7216 (self ):
369381 "7216 - test missing IFILE in tnsnames.ora"
0 commit comments