'A I{NULL} record with an arbitrary payload can be encoded and decoded as
part of a L{dns.Message}.'

def test_NULL(self):

    bytes = ''.join([dns._ord2bytes(i) for i in range(256)])
    rec = dns.Record_NULL(bytes)
    rr = dns.RRHeader('testname', dns.NULL, payload=rec)
    msg1 = dns.Message()
    msg1.answers.append(rr)
    s = BytesIO()
    msg1.encode(s)
    s.seek(0, 0)
    msg2 = dns.Message()
    msg2.decode(s)
    self.assertIsInstance(msg2.answers[0].payload, dns.Record_NULL)
    self.assertEqual(msg2.answers[0].payload.payload, bytes)
