Пример #1
0
 def test_firstNonZeroWithZero(self):
     v1 = Vector([0, 0, 1, 2])
     self.assertEqual(2, v1.firstNonZeroLoc())
     self.assertEqual(AutoReduceFraction(1), v1.firstNonZeroVal())
Пример #2
0
 def test_firstNonZeroWithNoZeroCorrect(self):
     v1 = Vector([1, 2, 3])
     self.assertEqual(0, v1.firstNonZeroLoc())
     self.assertEqual(AutoReduceFraction(1), v1.firstNonZeroVal())