Example #1
0
 def test_list(self):
     self.assertIsInstance(sum_to_target([2, 7, 11, 15], 9), list)
Example #2
0
 def test_str(self):
     with self.assertRaises(TypeError):
         sum_to_target("abcd", 9)
Example #3
0
 def test_normal(self):
     self.assertEqual(sum_to_target([2, 7, 11, 15], 9), [0, 1])
Example #4
0
 def test_diferente(self):
     self.assertEqual(sum_to_target([2, 7, 11, 15], 10), None)
Example #5
0
 def test_float(self):
     with self.assertRaises(TypeError):
         sum_to_target([1, 2], 3.4)
Example #6
0
 def test_list(self):
     with self.assertRaises(TypeError):
         sum_to_target([1, 2], [3])
Example #7
0
 def test_tuple(self):
     with self.assertRaises(TypeError):
         sum_to_target([1, 2], (3, ))
Example #8
0
 def test_str(self):
     with self.assertRaises(TypeError):
         sum_to_target([1, 2], "3")
Example #9
0
 def test_float(self):
     with self.assertRaises(TypeError):
         sum_to_target(9.5, 9)
Example #10
0
 def test_tuple(self):
     with self.assertRaises(TypeError):
         sum_to_target((9, 9, 9), 9)
Example #11
0
 def test_int(self):
     with self.assertRaises(TypeError):
         sum_to_target(1, 9)