Example #1
0
 def testConversionInBothDirections(self):
     '''Test converting a list from Python to C++ and back again.'''
     lu = ListUser()
     lst = [3, 5, 7]
     lu.setList(lst)
     result = lu.getList()
     self.assertEqual(result, lst)
Example #2
0
 def testConversionInBothDirectionsWithSimilarContainer(self):
     '''Test converting a tuple, instead of the expected list, from Python to C++ and back again.'''
     lu = ListUser()
     lst = (3, 5, 7)
     lu.setList(lst)
     result = lu.getList()
     self.assertNotEqual(result, lst)
     self.assertEqual(result, list(lst))
Example #3
0
 def testSumListFloats(self):
     '''Test method that sums a list of float values.'''
     lu = ListUser()
     lst = [3.3, 4.4, 5.5]
     result = lu.sumList(lst)
     self.assertEqual(result, sum(lst))
Example #4
0
 def testSumListIntegers(self):
     '''Test method that sums a list of integer values.'''
     lu = ListUser()
     lst = [3, 5, 7]
     result = lu.sumList(lst)
     self.assertEqual(result, sum(lst))