def test_equals(self):
     self.assertEqual(
         process_array([4, 8, 2, 7, 5], lambda val: val * 2),
         [8, 16, 4, 14, 10]
     )
 def test_equals_3(self):
     self.assertEqual(
         process_array([-1, 1, 2, 3, 4, 5], lambda val: val ** 3),
         [-1, 1, 8, 27, 64, 125]
     )
 def test_equals_4(self):
     self.assertEqual(process_array([], lambda val: val + 1), [])
 def test_equals_2(self):
     self.assertEqual(
         process_array([7, 8, 9, 1, 2], lambda val: val + 5),
         [12, 13, 14, 6, 7]
     )
示例#5
0
 def test_equals(self):
     self.assertEqual(process_array([4, 8, 2, 7, 5], lambda val: val * 2),
                      [8, 16, 4, 14, 10])
示例#6
0
 def test_equals_4(self):
     self.assertEqual(process_array([], lambda val: val + 1), [])
示例#7
0
 def test_equals_3(self):
     self.assertEqual(
         process_array([-1, 1, 2, 3, 4, 5], lambda val: val**3),
         [-1, 1, 8, 27, 64, 125])
示例#8
0
 def test_equals_2(self):
     self.assertEqual(process_array([7, 8, 9, 1, 2], lambda val: val + 5),
                      [12, 13, 14, 6, 7])