def test_searchFileForAliases(self):
        """
        For a host with a canonical name and one or more aliases,
        L{searchFileFor} can find an address given any of the names.
        """
        hosts = self.path()
        hosts.setContent(
            b"127.0.1.1\thelmut.example.org\thelmut\n"
            b"# a comment\n"
            b"::1 localhost ip6-localhost ip6-loopback\n")
        self.assertEqual(searchFileFor(hosts.path, b'helmut'), '127.0.1.1')
        self.assertEqual(
            searchFileFor(hosts.path, b'helmut.example.org'), '127.0.1.1')
        self.assertEqual(searchFileFor(hosts.path, b'ip6-localhost'), '::1')
        self.assertEqual(searchFileFor(hosts.path, b'ip6-loopback'), '::1')
        self.assertEqual(searchFileFor(hosts.path, b'localhost'), '::1')

        For a host with a canonical name and one or more aliases,
        L{searchFileFor} can find an address given any of the names.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/names/test/test_hosts.py