Example #1
0
 def testWeightingPicksTwoHighestWeightedError(self):
     inputData = [
         self.__HIT1, self.__2ERR2, self.__2ERR1, self.__1ERR, self.__NOHIT1
     ]
     parser = TXTErrorParser(inputData)
     result = parser.locateKeyErrors()
     self.assertEqual(sorted([self.__2ERR1, self.__2ERR2]), sorted(result))
Example #2
0
 def testWeightingReturnsAnEmptyArrayWithAnEmptyLogFile(self):
     parser = TXTErrorParser([])
     self.assertEqual([], parser.locateKeyErrors())
Example #3
0
 def testWeightingReturnsEmptyList(self):
     inputData = [self.__NOHIT1, self.__NOHIT2]
     parser = TXTErrorParser(inputData)
     self.assertEqual([], parser.locateKeyErrors())
Example #4
0
 def testWeightingPicksSingleHighestWeightedError(self):
     inputData = [self.__3ERR, self.__2ERR1, self.__1ERR]
     parser = TXTErrorParser(inputData)
     result = parser.locateKeyErrors()
     self.assertEqual([self.__3ERR], result)
Example #5
0
 def testWeightingReturnsAnEmptyArrayWithAnEmptyLogFile(self):
     parser = TXTErrorParser([])
     self.assertEqual([], parser.locateKeyErrors())
Example #6
0
 def testWeightingReturnsEmptyList(self):
     inputData = [self.__NOHIT1, self.__NOHIT2]
     parser = TXTErrorParser(inputData)
     self.assertEqual([], parser.locateKeyErrors())
Example #7
0
 def testWeightingPicksTwoHighestWeightedError(self):
     inputData = [self.__HIT1, self.__2ERR2, self.__2ERR1,
                  self.__1ERR, self.__NOHIT1]
     parser = TXTErrorParser(inputData)
     result = parser.locateKeyErrors()
     self.assertEqual(sorted([self.__2ERR1, self.__2ERR2]), sorted(result))
Example #8
0
 def testWeightingPicksSingleHighestWeightedError(self):
     inputData = [self.__3ERR, self.__2ERR1, self.__1ERR]
     parser = TXTErrorParser(inputData)
     result = parser.locateKeyErrors()
     self.assertEqual([self.__3ERR], result)