Ejemplo n.º 1
0
 def testEmpty2(self):
     t = type2Line("", self.chint)
     self.assertEqual(t, [])
Ejemplo n.º 2
0
 def testFourOk2(self):
     t = type2Line("3 33 111 222", self.chint)
     self.assertEqual(t.ints(), [[111]])
Ejemplo n.º 3
0
 def testThreeNg2(self):
     t = type2Line("123 456 789", self.chint)
     self.assertEqual(t, [])
Ejemplo n.º 4
0
 def testBrokenCruftOk2(self):
     t = type2Line("This is a pen 3 33 11 1 2 22 garble", self.chint)
     self.assertEqual(t.ints(), [[111]])
Ejemplo n.º 5
0
 def testMoreBrokenCruftOk2(self):
     t = type2Line(",3 , 33 1 1 1 2 22", self.chint)
     self.assertEqual(t.ints(), [[111]])
Ejemplo n.º 6
0
 def testMultipleValidSums(self):
     t = type2Line("333 111 222 blah 555 222 333", self.chint)
     self.assertEqual(t.ints(), [[222]])
Ejemplo n.º 7
0
 def testNonTotal(self):
     t = type2Line("333 111 222 222 333", self.chint)
     self.assertEqual(t.ints(), [])
Ejemplo n.º 8
0
 def testComplexLine(self):
     t = type2Line("Ordinary members 1,000 x 50 members 40,000 50,000 △10,000".decode("utf8"), self.chint)
     self.assertEqual(t.ints(), [[50000]])
Ejemplo n.º 9
0
 def testMaxOnly(self):
     t = type2Line("", self.chint)
     t.extend([self.ac333, self.ac222, self.ac111])
     t.max_only()
     self.assertEqual(t.ints(), [[333]])
Ejemplo n.º 10
0
 def testMaxOnlyWithTwoMaxVals(self):
     t = type2Line("", self.chint)
     t.extend([self.ac444, self.ac222, self.ac444, self.ac111])
     t.max_only()
     self.assertEqual(t.ints(), [[444]])