'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.'

def test_fromRRHeader(self):

    genericHeader = dns.RRHeader('example.com', type=dns.OPT, cls=65535, ttl=(((254 << 24) | (253 << 16)) | (True << 15)), payload=dns.UnknownRecord('\xff\xff\x00\x03abc'))
    decodedOptHeader = dns._OPTHeader.fromRRHeader(genericHeader)
    expectedOptHeader = dns._OPTHeader(udpPayloadSize=65535, extendedRCODE=254, version=253, dnssecOK=True, options=[dns._OPTVariableOption(code=65535, data='abc')])
    self.assertEqual(decodedOptHeader, expectedOptHeader)
