gh-100374: Fixed a bug in socket.getfqdn() (gh-100375)

This commit is contained in:
Dominic Socular 2022-12-21 21:25:04 +08:00 committed by GitHub
parent a7715ccfba
commit 12be23cf3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions

View file

@ -1769,6 +1769,10 @@ class GeneralModuleTests(unittest.TestCase):
)
self.assertEqual(sockaddr, ('ff02::1de:c0:face:8d', 1234, 0, 0))
def test_getfqdn_filter_localhost(self):
self.assertEqual(socket.getfqdn(), socket.getfqdn("0.0.0.0"))
self.assertEqual(socket.getfqdn(), socket.getfqdn("::"))
@unittest.skipUnless(socket_helper.IPV6_ENABLED, 'IPv6 required for this test.')
@unittest.skipIf(sys.platform == 'win32', 'does not work on Windows')
@unittest.skipIf(AIX, 'Symbolic scope id does not work')