示例#1
0
 def test_digit1(self):
     digitOne = "   \n  |\n  |\n   "
     self.assertEquals(ocrMachine(digitOne),1)
示例#2
0
 def test_wholestring(self):
     s = "    _  _     _  _  _  _  _ \n" \
       + "  | _| _||_||_ |_   ||_||_|\n" \
       + "  ||_  _|  | _||_|  ||_| _|\n" \
       + "                           "
     self.assertEquals(ocrMachine(s), 123456789)
示例#3
0
 def test_digit3(self):
     digit_three = " _ \n _|\n _|\n   "
     self.assertEquals(ocrMachine(digit_three), 3)
示例#4
0
 def test_digits12(self):
     digits_12 = "    _ \n  | _|\n  ||_ \n      "
     self.assertEquals(ocrMachine(digits_12), 12)
示例#5
0
 def test_digit2(self):
     digit_two = " _ \n _|\n|_ \n   "
     self.assertEqual(ocrMachine(digit_two), 2)