Example #1
0
 def test_iteration(self):
     """Tests the iteration"""
     x = IteratorOfTwistedIntegers(TwistedIntegers(3))
     j = 0
     for i in x:
         self.assertEqual("<" + str(j) + ":3>", str(i))
         j += 1
Example #2
0
 def test_iteration_mulValidHundred(self):
     """Tests the multiplication function of the iterator when n = 100"""
     self.assertEqual(['<0:100>'],
                      IteratorOfTwistedIntegers.multiplication(100))
Example #3
0
 def test_iteration_mulValidFortyTwo(self):
     """Tests the multiplication function of the iterator when n = 42"""
     self.assertEqual(['<0:42>'],
                      IteratorOfTwistedIntegers.multiplication(42))
Example #4
0
 def test_iteration_mulValidTwenty(self):
     """Tests the multiplication function of the iterator when n = 20"""
     self.assertEqual(['<0:20>'],
                      IteratorOfTwistedIntegers.multiplication(20))
Example #5
0
 def test_iteration_mulValidFive(self):
     """Tests the multiplication function of the iterator when n = 5"""
     self.assertEqual(['<0:5>'],
                      IteratorOfTwistedIntegers.multiplication(5))
Example #6
0
 def test_iteration_addValidFive(self):
     """Tests the addition function of the iterator when n = 5"""
     self.assertEqual(['<0:5>'], IteratorOfTwistedIntegers.addition(5))