def testFixedWithPad(self):
data = 'abcd'
expected = Bits(bytes='abcd\xff\xff\xff\xff\xff\xff')
uut = Pad(pad_length=10 * 8, fields=Static(data), pad_data='\xff')
uut_num_mutations = uut.num_mutations()
self.assertEqual(uut_num_mutations, 0)
actual_num_mutations = 0
while uut.mutate():
actual_num_mutations += 1
self.assertEqual(actual_num_mutations, uut_num_mutations)
self.assertEqual(uut.render(), expected)
评论列表
文章目录