def test_searchFileForAliases(self):
        hosts = FilePath(self.mktemp())
        hosts.setContent(
            "127.0.1.1	helmut.example.org	helmut\n"
            "# a comment\n"
            "::1     localhost ip6-localhost ip6-loopback\n")
        self.assertEqual(searchFileFor(hosts.path, 'helmut'), '127.0.1.1')
        self.assertEqual(
            searchFileFor(hosts.path, 'helmut.example.org'), '127.0.1.1')
        self.assertEqual(searchFileFor(hosts.path, 'ip6-localhost'), '::1')
        self.assertEqual(searchFileFor(hosts.path, 'ip6-loopback'), '::1')
        self.assertEqual(searchFileFor(hosts.path, 'localhost'), '::1')
For a host with a canonical name and one or more aliases,
dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/names/test/test_hosts.py/SearchHostsFileTests.test_searchFileForAliases