def METHOD_NAME(self):
    abnf_bad_rsv_bits = ABNF(2,0,0,0, opcode=ABNF.OPCODE_TEXT)
    self.assertRaises(ValueError, abnf_bad_rsv_bits.format)
    abnf_bad_opcode = ABNF(0,0,0,0, opcode=5)
    self.assertRaises(ValueError, abnf_bad_opcode.format)
    abnf_length_10 = ABNF(0,0,0,0, opcode=ABNF.OPCODE_TEXT, data="abcdefghij")
    self.assertEqual(b'\x01', abnf_length_10.format()[0].to_bytes(1, 'big'))
    self.assertEqual(b'\x8a', abnf_length_10.format()[1].to_bytes(1, 'big'))
    self.assertEqual("fin=0 opcode=1 data=abcdefghij", abnf_length_10.__str__())
    abnf_length_20 = ABNF(0,0,0,0, opcode=ABNF.OPCODE_BINARY, data="abcdefghijabcdefghij")
    self.assertEqual(b'\x02', abnf_length_20.format()[0].to_bytes(1, 'big'))
    self.assertEqual(b'\x94', abnf_length_20.format()[1].to_bytes(1, 'big'))
    abnf_no_mask = ABNF(0,0,0,0, opcode=ABNF.OPCODE_TEXT, mask=0, data=b'\x01\x8a\xcc')
    self.assertEqual(b'\x01\x03\x01\x8a\xcc', abnf_no_mask.format())