예제 #1
0
 def test_2(self):
     l1 = [1, 3, 6, 9]
     l2 = map.add_n_all(5, l1)
     self.assertListAlmostEqual(l2, [6, 8, 11, 14])
     l1 = [4, 8, 12, 16]
     l2 = map.add_n_all(11, l1)
     self.assertListAlmostEqual(l2, [15, 19, 23, 27])
예제 #2
0
 def test_3(self):
     t = [1, 2, 3, 4, 5]
     self.assertEqual(map.add_n_all(t, 2), [3, 4, 5, 6, 7])
예제 #3
0
 def test_add_n_all_2(self):
     l1 = map.add_n_all([0.0, 1.0, 2.0], -1)
     l2 = [-1.0, 0.0, 1.0]
     self.assertListAlmostEqual(l1, l2)
예제 #4
0
 def test_add_n_all_1(self):
     l1 = map.add_n_all([0.0, 1.0, 2.0], 1)
     l2 = [1.0, 2.0, 3.0]
     self.assertListAlmostEqual(l1, l2)
예제 #5
0
 def test_add_n_all_2(self):
     iList = [0, 10, 4]
     increment = 2
     oList = [2, 12, 6]
     self.assertListEqual(map.add_n_all(iList, increment), oList)
예제 #6
0
 def test_add_n_all_2(self):
     input_list = [2, 3, 9, 7]
     n = -5
     self.assertListEqual(map.add_n_all(input_list, n), [-3, -2, 4, 2])
예제 #7
0
 def test_add_n_all2(self):
     numb_list = [11, 22, 33, 44]
     n = 3
     new_list = [14, 25, 36, 47]
     self.assertEqual(map.add_n_all(numb_list, n), new_list)
예제 #8
0
 def test_add_n_all_2(self):
     nums = [5, 0, 8, 3]
     value = 4
     add = map.add_n_all(nums, value)
     self.assertListAlmostEqual(add, [9, 4, 12, 7])
예제 #9
0
 def test_add_n_all(self):
    list_sum = map.add_n_all([0,0,0], 2)
    self.assertEqual(list_sum, [2,2,2])
예제 #10
0
 def test_add_n_all2(self):
     list = [15,20,25,30,35,-5]
     n = 5
     map.add_n_all(list,n)
     list.__eq__([20,25,30,35,40,0])
예제 #11
0
 def test_add_n_all1(self):
     list = [1,2,3,4]
     n = 1
     map.add_n_all(list,n)
     list.__eq__([2,3,4,5])
예제 #12
0
 def test_add2(self):
     self.assertEqual(map.add_n_all([1, 2, 3, 4, 5], -5),
                      [-4, -3, -2, -1, 0])
예제 #13
0
 def test_add(self):
     self.assertEqual(map.add_n_all([1, 2, 3, 4, 5], 3), [4, 5, 6, 7, 8])
예제 #14
0
 def test_add_n_all(self):
     list1 = [2, 4, 6, 8]
     list2 = [1, 3, 5]
     self.assertListEqual(map.add_n_all(list1, 3), [5, 7, 9, 11])
     self.assertListEqual(map.add_n_all(list2, 5), [6, 8, 10])
예제 #15
0
 def test_4(self):
     t = [1, -2, 3, -4, 5]
     self.assertEqual(map.add_n_all(t, -1), [0, -3, 2, -5, 4])
예제 #16
0
 def test_add_n_all_1(self):
     nums = [1, 2, 3, 4]
     value = 2
     add = map.add_n_all(nums, value)
     self.assertListAlmostEqual(add, [3, 4, 5, 6])
예제 #17
0
 def test_add_n_all_2(self):
    list_sum = map.add_n_all([1,1,1], 2)
    self.assertEqual(list_sum, [3,3,3])   
예제 #18
0
 def test_add_n_all1(self):
     numb_list = [1, 2, 3]
     n = 1
     new_list = [2, 3, 4]
     self.assertEqual(map.add_n_all(numb_list, n), new_list)
예제 #19
0
 def test_3(self):
     x = [1, 4, 5]
     self.assertAlmostEqual(map.add_n_all(x, 3), [4, 7, 8])
예제 #20
0
 def test_add_n_all_1(self):
     input_list = [3, 2, 1, 4]
     n = 1
     self.assertListEqual(map.add_n_all(input_list, n), [4, 3, 2, 5])
예제 #21
0
 def test_4(self):
     x = [0, -2, 4]
     self.assertAlmostEqual(map.add_n_all(x, 1), [1, -1, 5])
예제 #22
0
 def test_add_n_all(self):
    self.assertAlmostEqual(map.add_n_all(test1, n), test5)
    self.assertAlmostEqual(map.add_n_all(test3, n), test6)
예제 #23
0
 def test_add_n_all_1(self):
     iList = [-100, -50, 73]
     increment = 5
     oList = [-95, -45, 78]
     self.assertListEqual(map.add_n_all(iList, increment), oList)