def test_fromRRHeader(self):
        """
        L{_OPTHeader.fromRRHeader} accepts an L{RRHeader} instance and
        returns an L{_OPTHeader} instance whose attribute values have
        been derived from the C{cls}, C{ttl} and C{payload} attributes
        of the original header.
        """
        genericHeader = dns.RRHeader(
            b'example.com',
            type=dns.OPT,
            cls=0xffff,
            ttl=(0xfe << 24
                 | 0xfd << 16
                 | True << 15),
            payload=dns.UnknownRecord(b'\xff\xff\x00\x03abc'))

        decodedOptHeader = dns._OPTHeader.fromRRHeader(genericHeader)

        expectedOptHeader = dns._OPTHeader(
            udpPayloadSize=0xffff,
            extendedRCODE=0xfe,
            version=0xfd,
            dnssecOK=True,
            options=[dns._OPTVariableOption(code=0xffff, data=b'abc')])

        self.assertEqual(decodedOptHeader, expectedOptHeader)

        L{_OPTHeader.fromRRHeader} accepts an L{RRHeader} instance and
        returns an L{_OPTHeader} instance whose attribute values have
        been derived from the C{cls}, C{ttl} and C{payload} attributes
        of the original header.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/names/test/test_dns.py