def testAlwaysRenderedAsEmptyBits(self): field = String('abc') uut = Meta(name=self.uut_name, fields=[field], fuzzable=True) self.assertEqual(len(uut.render()), 0) while uut.mutate(): self.assertEqual(len(uut.render()), 0) uut.reset() self.assertEqual(len(uut.render()), 0) while uut.mutate(): self.assertEqual(len(uut.render()), 0)
def testIsFuzzable(self): field = String('abc') uut = Meta(name='uut', fields=[field], fuzzable=True) num_mutations = uut.num_mutations() self.assertGreater(num_mutations, 0) self.assertGreaterEqual(num_mutations, field.num_mutations()) actual_num_mutations = 0 while uut.mutate(): actual_num_mutations += 1 self.assertEqual(actual_num_mutations, num_mutations)
def testIsFuzzable(self): field = String('abc') uut = Meta(name=self.uut_name, fields=[field], fuzzable=True) num_mutations = uut.num_mutations() self.assertGreater(num_mutations, 0) self.assertGreaterEqual(num_mutations, field.num_mutations()) actual_num_mutations = 0 while uut.mutate(): actual_num_mutations += 1 self.assertEqual(actual_num_mutations, num_mutations)
def testIsNotFuzzable(self): field = String('abc') uut = Meta(name='uut', fields=[field], fuzzable=False) self.assertEqual(uut.num_mutations(), 0) self.assertFalse(uut.mutate())
def testIsNotRenderedWhenFuzzable(self): field = String('abc') uut = Meta(name='uut', fields=[field], fuzzable=True) while uut.mutate(): self.assertEqual(len(uut.render()), 0)
def testIsNotFuzzable(self): field = String('abc') uut = Meta(name=self.uut_name, fields=[field], fuzzable=False) self.assertEqual(uut.num_mutations(), 0) self.assertFalse(uut.mutate())
def testIsNotRenderedWhenFuzzable(self): field = String('abc') uut = Meta(name=self.uut_name, fields=[field], fuzzable=True) while uut.mutate(): self.assertEqual(len(uut.render()), 0)