Ejemplo n.º 1
0
 def checkImage(self, directory, filename):
     print("Testing image {} ".format(filename))
     name = os.path.splitext(filename)[0]
     expectedStr = name.split("__")[1]
     expectedList = [int(x) for x in expectedStr]
     fullFilename = os.path.join(directory, filename) 
     scanner.setCameraDebugValues()
     actualResult = scanner.getVotesFromImage(fullFilename)
     if(actualResult != expectedList):
         cv2.waitKey(10001)
     self.assertEqual(actualResult, expectedList, msg="\nFailure for test image: {}".format(fullFilename))
     print("Success for" + filename)
Ejemplo n.º 2
0
 def checkImage(self, directory, filename):
     print("Testing image {} ".format(filename))
     name = os.path.splitext(filename)[0]
     expectedStr = name.split("__")[1]
     expectedList = [int(x) for x in expectedStr]
     fullFilename = os.path.join(directory, filename)
     scanner.setCameraDebugValues()
     actualResult = scanner.getVotesFromImage(fullFilename)
     if (actualResult != expectedList):
         cv2.waitKey(10001)
     self.assertEqual(
         actualResult,
         expectedList,
         msg="\nFailure for test image: {}".format(fullFilename))
     print("Success for" + filename)
Ejemplo n.º 3
0
 def test_card_1(self):
     l = getVotesFromImage("../testimages/card__859724459716.jpg")
     expected = [8, 5, 9, 7, 2, 4, 4, 5, 9, 7, 1, 6]
     self.assertEqual(l, expected)