示例#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)