@@ -162,8 +162,7 @@ def test_init_disconnected(self):
162162 ctx .exit ()
163163
164164 c .pymongo_test .test .find_one () # Auto-connect.
165- self .assertEqual (host , c .host )
166- self .assertEqual (port , c .port )
165+ self .assertEqual ((host , port ), c .address )
167166
168167 if version .at_least (c , (2 , 5 , 4 , - 1 )):
169168 self .assertTrue (c .max_wire_version > 0 )
@@ -219,8 +218,7 @@ def test_repr(self):
219218 "MongoClient('%s', %d)" % (host , port ))
220219
221220 def test_getters (self ):
222- self .assertEqual (MongoClient (host , port ).host , host )
223- self .assertEqual (MongoClient (host , port ).port , port )
221+ self .assertEqual (MongoClient (host , port ).address , (host , port ))
224222 self .assertEqual (set ([(host , port )]),
225223 MongoClient (host , port ).nodes )
226224
@@ -1056,7 +1054,7 @@ def test_wire_version_mongos_ha(self):
10561054 c .db .collection .find_one () # Connect.
10571055
10581056 # Which member did we use?
1059- used_host = '%s:%s' % ( c . host , c . port )
1057+ used_host = '%s:%s' % c . address
10601058 expected_min , expected_max = c .mock_wire_versions [used_host ]
10611059 self .assertEqual (expected_min , c .min_wire_version )
10621060 self .assertEqual (expected_max , c .max_wire_version )
@@ -1066,7 +1064,7 @@ def test_wire_version_mongos_ha(self):
10661064 c .set_wire_version_range ('c:3' , 0 , 0 )
10671065 c .close ()
10681066 c .db .collection .find_one ()
1069- used_host = '%s:%s' % ( c . host , c . port )
1067+ used_host = '%s:%s' % c . address
10701068 expected_min , expected_max = c .mock_wire_versions [used_host ]
10711069 self .assertEqual (expected_min , c .min_wire_version )
10721070 self .assertEqual (expected_max , c .max_wire_version )
@@ -1184,8 +1182,7 @@ def test_discover_primary(self):
11841182 host = 'b:2' , # Pass a secondary.
11851183 replicaSet = 'rs' )
11861184
1187- self .assertEqual ('a' , c .host )
1188- self .assertEqual (1 , c .port )
1185+ self .assertEqual (('a' , 1 ), c .address )
11891186 self .assertEqual (3 , len (c .nodes ))
11901187
11911188 # Fail over.
@@ -1195,8 +1192,7 @@ def test_discover_primary(self):
11951192 # Force reconnect.
11961193 c .close ()
11971194 c .db .collection .find_one ()
1198- self .assertEqual ('b' , c .host )
1199- self .assertEqual (2 , c .port )
1195+ self .assertEqual (('b' , 2 ), c .address )
12001196
12011197 # a:1 is still in nodes.
12021198 self .assertEqual (3 , len (c .nodes ))
0 commit comments