Esempio n. 1
0
 def test_with_multiple_same_nums_floats(self):
     result = avg([5.00, 5.00, 5.00, 2.00, 2.00])
     self.assertIsInstance(result, float)
     self.assertEqual(19 / 5, result)
Esempio n. 2
0
 def test_with_multiple_same_nums(self):
     result = avg([5, 5, 5, 2, 2])
     self.assertIsInstance(result, float)
     self.assertEqual(19 / 5, result)
Esempio n. 3
0
 def test_with_sring_in_list_arg(self):
     with self.assertRaises(TypeError):
         avg([1, 2, 'hello', 4])
Esempio n. 4
0
 def test_with_unordered(self):
     result = avg([4, 5, 1, 3, 2])
     self.assertIsInstance(result, float)
     self.assertEqual(3, result)
Esempio n. 5
0
 def test_with_sring_arg(self):
     with self.assertRaises(TypeError):
         avg('hello')
Esempio n. 6
0
 def test_with_1_num(self):
     result = avg([5])
     self.assertIsInstance(result, float)
     self.assertEqual(result, 5)