def test_idnaHostname(self):
        """
        When IDN is passed to the L{HostnameEndpoint} constructor the string
        representation includes the punycode version of the host.
        """
        endpoint = endpoints.HostnameEndpoint(
            deterministicResolvingReactor(Clock(), []),
            u'b\xfccher.ch', 443,
        )

        rep = repr(endpoint)

        self.assertEqual("<HostnameEndpoint xn--bcher-kva.ch:443>", rep)
        self.assertIs(str, type(rep))

        When IDN is passed to the L{HostnameEndpoint} constructor the string
        representation includes the punycode version of the host.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/test/test_endpoints.py