def test_decodeAllExpectedBytes(self):
        """
        L{dns._OPTHeader.decode} reads all the bytes of the record
        that is being decoded.
        """
        # Check that all the input data has been consumed.
        b = BytesIO(OPTNonStandardAttributes.bytes())

        decodedHeader = dns._OPTHeader()
        decodedHeader.decode(b)

        self.assertEqual(b.tell(), len(b.getvalue()))

        L{dns._OPTHeader.decode} reads all the bytes of the record
        that is being decoded.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/names/test/test_dns.py