Example #1
0
 def testSingleByteDefaultRangeIs1to5(self):
     uut = BitFlips('\x00')
     expected_mutations = self._generate_mutations(1, range(1, 5))
     mutations = map(lambda x: x.tobytes(), self.get_all_mutations(uut))
     self.assertGreaterEqual(len(mutations), len(expected_mutations))
     for em in expected_mutations:
         self.assertIn(em, mutations)
Example #2
0
 def _testBase(self, num_bytes, itr, uut=None):
     if uut is None:
         uut = BitFlips('\x00' * num_bytes, itr)
     expected_mutations = self._generate_mutations(num_bytes, itr)
     mutations = map(lambda x: x.tobytes(), self.get_all_mutations(uut))
     self.assertGreaterEqual(len(mutations), len(expected_mutations))
     for em in expected_mutations:
         self.assertIn(em, mutations)
 def get_field(self, value=b'\x00\x00'):
     return BitFlips(value=value)
 def testExceptionIfUnorderedRangeOverflowsMultipleBytes(self):
     with self.assertRaises(KittyException):
         BitFlips(b'\x00', bits_range=[12, 33, 7])
 def testExceptionIfRangeOverflowsMultipleBytes(self):
     with self.assertRaises(KittyException):
         BitFlips(b'\x00\x00\x00\x00', bits_range=[33])
 def testExceptionIfUnorderedRangeOverflowsSingleByte(self):
     with self.assertRaises(KittyException):
         BitFlips(b'\x00', bits_range=[2, 9, 1])
Example #7
0
 def testExceptionIfRangeOverflowsSingleByte(self):
     with self.assertRaises(KittyException):
         BitFlips('\x00', bits_range=[9])