Beispiel #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))
Beispiel #2
0
 def testWeightingReturnsAnEmptyArrayWithAnEmptyLogFile(self):
     parser = TXTErrorParser([])
     self.assertEqual([], parser.locateKeyErrors())
Beispiel #3
0
 def testWeightingReturnsEmptyList(self):
     inputData = [self.__NOHIT1, self.__NOHIT2]
     parser = TXTErrorParser(inputData)
     self.assertEqual([], parser.locateKeyErrors())
Beispiel #4
0
 def testWeightingPicksSingleHighestWeightedError(self):
     inputData = [self.__3ERR, self.__2ERR1, self.__1ERR]
     parser = TXTErrorParser(inputData)
     result = parser.locateKeyErrors()
     self.assertEqual([self.__3ERR], result)
Beispiel #5
0
 def testWeightingReturnsAnEmptyArrayWithAnEmptyLogFile(self):
     parser = TXTErrorParser([])
     self.assertEqual([], parser.locateKeyErrors())
Beispiel #6
0
 def testWeightingReturnsEmptyList(self):
     inputData = [self.__NOHIT1, self.__NOHIT2]
     parser = TXTErrorParser(inputData)
     self.assertEqual([], parser.locateKeyErrors())
Beispiel #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))
Beispiel #8
0
 def testWeightingPicksSingleHighestWeightedError(self):
     inputData = [self.__3ERR, self.__2ERR1, self.__1ERR]
     parser = TXTErrorParser(inputData)
     result = parser.locateKeyErrors()
     self.assertEqual([self.__3ERR], result)