def test_returnCanonicalName(self):
        """
        If a I{CNAME} record is encountered as the answer to a query for
        another record type, that record is returned as the answer.
        """
        servers = {
            ('1.1.2.3', 53): {
                (b'example.com', A): {
                    'answers': [(b'example.com', Record_CNAME(b'example.net')),
                                (b'example.net', Record_A('10.0.0.7'))],
                    },
                },
            }
        resolver = self._getResolver(servers)
        d = resolver.lookupAddress(b'example.com')
        d.addCallback(lambda results: results[0]) # Get the answer section
        d.addCallback(
            self.assertEqual,
            [RRHeader(b'example.com', CNAME, payload=Record_CNAME(b'example.net')),
             RRHeader(b'example.net', A, payload=Record_A('10.0.0.7'))])
        return d

        If a I{CNAME} record is encountered as the answer to a query for
        another record type, that record is returned as the answer.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/names/test/test_rootresolve.py