@@ -273,6 +273,13 @@ async def test_gssapi_threaded(self):
273273 self .assertTrue (thread .success )
274274
275275 async def test_gssapi_canonicalize_host_name (self ):
276+ # Test the low level method.
277+ result = _canonicalize_hostname (GSSAPI_HOST , "forward" )
278+ if "compute-1.amazonaws.com" not in result :
279+ self .assertEqual (result , GSSAPI_HOST )
280+ result = _canonicalize_hostname (GSSAPI_HOST , "forwardAndReverse" )
281+ self .assertEqual (result , GSSAPI_HOST )
282+
276283 # Use the equivalent named CANONICALIZE_HOST_NAME.
277284 props = self .mech_properties .copy ()
278285 if props ["CANONICALIZE_HOST_NAME" ] == "true" :
@@ -292,18 +299,6 @@ async def test_gssapi_canonicalize_host_name(self):
292299 if props ["CANONICALIZE_HOST_NAME" ] == "none" :
293300 return
294301
295- # Test with "forward".
296- props ["CANONICALIZE_HOST_NAME" ] = "forward"
297- client = self .simple_client (
298- GSSAPI_HOST ,
299- GSSAPI_PORT ,
300- username = GSSAPI_PRINCIPAL ,
301- password = GSSAPI_PASS ,
302- authMechanism = "GSSAPI" ,
303- authMechanismProperties = props ,
304- )
305- await client .server_info ()
306-
307302 async def test_gssapi_host_name (self ):
308303 props = self .mech_properties
309304 props ["SERVICE_HOST" ] = "example.com"
@@ -331,13 +326,6 @@ async def test_gssapi_host_name(self):
331326 )
332327 await client .server_info ()
333328
334- def test_canonicalize_host_name (self ):
335- result = _canonicalize_hostname (GSSAPI_HOST , "forward" )
336- if "compute-1.amazonaws.com" not in result :
337- self .assertEqual (result , GSSAPI_HOST )
338- result = _canonicalize_hostname (GSSAPI_HOST , "forwardAndReverse" )
339- self .assertEqual (result , GSSAPI_HOST )
340-
341329
342330class TestSASLPlain (AsyncPyMongoTestCase ):
343331 @classmethod
0 commit comments