Exemplo n.º 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
Exemplo n.º 2
0
 def test_iteration_mulValidHundred(self):
     """Tests the multiplication function of the iterator when n = 100"""
     self.assertEqual(['<0:100>'],
                      IteratorOfTwistedIntegers.multiplication(100))
Exemplo n.º 3
0
 def test_iteration_mulValidFortyTwo(self):
     """Tests the multiplication function of the iterator when n = 42"""
     self.assertEqual(['<0:42>'],
                      IteratorOfTwistedIntegers.multiplication(42))
Exemplo n.º 4
0
 def test_iteration_mulValidTwenty(self):
     """Tests the multiplication function of the iterator when n = 20"""
     self.assertEqual(['<0:20>'],
                      IteratorOfTwistedIntegers.multiplication(20))
Exemplo n.º 5
0
 def test_iteration_mulValidFive(self):
     """Tests the multiplication function of the iterator when n = 5"""
     self.assertEqual(['<0:5>'],
                      IteratorOfTwistedIntegers.multiplication(5))
Exemplo n.º 6
0
 def test_iteration_addValidFive(self):
     """Tests the addition function of the iterator when n = 5"""
     self.assertEqual(['<0:5>'], IteratorOfTwistedIntegers.addition(5))