'L{dns._OPTHeader.options} is a list of L{dns._OPTVariableOption}
instances which are packed into the rdata area of the header.'

def test_encodeWithOptions(self):

    h = OPTNonStandardAttributes.object()
    h.options = [dns._OPTVariableOption(1, 'foobarbaz'), dns._OPTVariableOption(2, 'qux')]
    b = BytesIO()
    h.encode(b)
    self.assertEqual(b.getvalue(), (OPTNonStandardAttributes.bytes(excludeOptions=True) + '\x00\x14\x00\x01\x00 DCTB foobarbaz\x00\x02\x00\x03qux'))
