def test_fuzz_in_range(self): for x in range(self.sf.len): self.sf.tries = x with InsertFuzzer(*self.args) as f: f._fuzz() self.assertEqual(len(f.output), self.sf.len + 1) self.assertEqual(chr(f.output[x + 1]), self.sf.value[x]) if x > 0: self.assertEqual(chr(f.output[x - 1]), self.sf.value[x - 1])
def test_is_not_minimizable(self): f = InsertFuzzer(*self.args) self.assertFalse(f.is_minimizable)
def test_fuzz_out_of_range(self): self.sf.tries = self.sf.len + 1 with InsertFuzzer(*self.args) as f: self.assertRaises(FuzzerExhaustedError, f._fuzz)