コード例 #1
0
 def test_medium_input_two(self):
     with self.assertRaises(Exception):
         self.assertEqual(avg(10, 10, 10, 10, '10'), 10)
コード例 #2
0
 def test_hard_input(self):
     with self.assertRaises(Exception):
         self.assertEqual(avg(1, 2, 3, None), 2)
コード例 #3
0
 def test_medium_input_two(self):
     with self.assertRaises(TypeError):
         self.assertEqual(avg(1, 2, "3"), 2)
コード例 #4
0
 def test_medium_input(self):
     with self.assertRaises(Exception):
         self.assertEqual(avg(1, 2, 3, 'Joanna'), 2)
コード例 #5
0
 def test_medium_input_2(self):
     with self.assertRaises(TypeError):
         self.assertEqual(avg(10, 10, "10"), 10)
コード例 #6
0
 def test_easy_input(self):
     self.assertEqual(avg(1, 2, 3), 2.0)
コード例 #7
0
 def test_hard_input_four(self):
     with self.assertRaises(TypeError):
         self.assertEqual(avg(1, 2, 3, 4, 5, 6, 7, frozenset), 4)
コード例 #8
0
 def test_hard_input_four(self):
     with self.assertRaises(Exception):
         self.assertEqual(avg(10, 10, 10, 10, set), 10)
コード例 #9
0
 def test_medium_input_two(self):
     with self.assertRaises(TypeError):
         self.assertEqual(avg(1, 2, 3, 4, 5, 6, 7, "100"), 4)
コード例 #10
0
 def test_hard_input_three(self):
     with self.assertRaises(TypeError):
         self.assertEqual(avg(1, 2, 3, 4, 5, 6, 7, set), 4)
コード例 #11
0
 def test_hard_input_three(self):
     with self.assertRaises(TypeError):
         self.assertEqual(avg(10, 10, 10, 10, frozenset), 10)
コード例 #12
0
 def test_hard_input_four(self):
     with self.assertRaises(TypeError):
         self.assertEqual(avg(1, 2, set), 2)
コード例 #13
0
 def test_hard_input_two(self):
     with self.assertRaises(TypeError):
         self.assertEqual(avg(1, 2, float), 2)
コード例 #14
0
 def test_hard_input_two(self):
     with self.assertRaises(Exception):
         self.assertEqual(avg(10, 10, 10, 10, 1.5), 10)
コード例 #15
0
 def test_easy_input(self):
     self.assertEqual(avg(1, 2, 3, 4, 5, 6, 7), 4)
     pass
コード例 #16
0
 def test_hard_input_three(self):
     with self.assertRaises(Exception):
         self.assertEqual(avg(10, 10, 10, 10, frozenset), 10)
コード例 #17
0
 def test_easy_input_three(self):
     # True jest traktowane jako liczba 1
     self.assertEqual(avg(1, 1, 1, 1, 1, True), 1)
コード例 #18
0
 def test_medium_input(self):
     with self.assertRaises(TypeError):
         self.assertEqual(avg(1, 2, 3, "Mohammad"), 2.0)
コード例 #19
0
 def test_hard_input(self):
     with self.assertRaises(TypeError):
         self.assertEqual(avg(1,2,3,4, None), 2)
コード例 #20
0
 def test_hard_input_4(self):
     with self.assertRaises(TypeError):
         self.assertEqual(avg(10, 10, set), 10)
コード例 #21
0
 def test_hard_input_three(self):
     #not significat
     with self.assertRaises(TypeError):
         self.assertEqual(avg(10, 10, 10, 10, 10, set), 10)
コード例 #22
0
 def test_easy_input_2(self):
     self.assertEqual(avg(10, 10, 10), 10)
コード例 #23
0
 def test_medium_input(self):
     with self.assertRaises(TypeError):
         self.assertEqual(avg(1, 2, 3, "Augusto"), 2)