def _answerCNAMETest(self, addresses):
        """
        Verify that a response to a CNAME query has certain records in the
        I{answer} section.

        @param addresses: See C{_additionalTest}
        """
        target = b"www." + soa_record.mname.name
        d = self._lookupSomeRecords(
            "lookupCanonicalName", soa_record, dns.Record_CNAME, target,
            addresses)
        answer, authority, additional = self.successResultOf(d)

        alias = dns.RRHeader(
            soa_record.mname.name, dns.CNAME, ttl=soa_record.expire,
            payload=dns.Record_CNAME(target), auth=True)
        self.assertRecordsMatch(
            [dns.RRHeader(
                    target, address.TYPE, ttl=soa_record.expire, payload=address,
                    auth=True)
             for address in addresses] + [alias],
            answer)

        Verify that a response to a CNAME query has certain records in the
        I{answer} section.

        @param addresses: See C{_additionalTest}
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/names/test/test_names.py