def test_decodeWithOptions(self):
        """
        If the OPT bytes contain variable options,
        L{dns._OPTHeader.decode} will populate a list
        L{dns._OPTHeader.options} with L{dns._OPTVariableOption}
        instances.
        """

        b = BytesIO(
            OPTNonStandardAttributes.bytes(excludeOptions=True) + (

                b'\x00\x14' # RDLEN 20

                b'\x00\x01' # OPTION-CODE
                b'\x00\x09' # OPTION-LENGTH
                b'foobarbaz' # OPTION-DATA

                b'\x00\x02' # OPTION-CODE
                b'\x00\x03' # OPTION-LENGTH
                b'qux' # OPTION-DATA
                ))

        h = dns._OPTHeader()
        h.decode(b)
        self.assertEqual(
            h.options,
            [dns._OPTVariableOption(1, b'foobarbaz'),
             dns._OPTVariableOption(2, b'qux'),]
            )

        If the OPT bytes contain variable options,
        L{dns._OPTHeader.decode} will populate a list
        L{dns._OPTHeader.options} with L{dns._OPTVariableOption}
        instances.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/names/test/test_dns.py