def test_average_exception(self):
     try:
         with self.assertRaises(ValueError):
             average(90, 89, -78)
     except ValueError:
         print("ValueError not raised")
     else:
         print("ValueError raised")
Example #2
0
 def test_average_negative_input(self):
     with self.assertRaises(ValueError):
         validation_with_try.average(-90, 89, 78)
     with self.assertRaises(ValueError):
         validation_with_try.average(90, -89, 78)
     with self.assertRaises(ValueError):
         validation_with_try.average(90, 89, -78)
    def test_average_exception(self):
        with self.assertRaises(ValueError):
            average(-90, 89, 78)

        with self.assertRaises(ValueError):
            average(90, -89, 78)

        with self.assertRaises(ValueError):
            average(90, 89, -78)
 def test_average_exception_2(self):
     with self.assertRaises(ValueError):
         validation_with_try.average(90, -89, 78)
Example #5
0
 def test_average_negative_input(self):
     with self.assertRaises(ValueError):
         validation_with_try.average(-1, 1, 1)
Example #6
0
 def test_average_negative_input_index_two(self):
     with self.assertRaises(ValueError):
         validation_with_try.average(90, 90, -99)
 def test_average_negative(self):
     self.assertNotEqual(v.average(100, 87, 91), 90)
 def test_average_positive(self):
     self.assertEqual(v.average(98, 93, 88), 93)
Example #9
0
 def test_average_string_input(self):
     with self.assertRaises(ValueError):
         avg.average(90, 'dog', 78)
Example #10
0
 def test_average_negative_input_score3(self):
     with self.assertRaises(ValueError):
         avg.average(90, 89, -78)
Example #11
0
 def test_average_negative_input(self):
     with self.assertRaises(ValueError):
         avg.average(90, -89, 78)
Example #12
0
def test_average_exception(self):
    with self.assertRaises(ValueError):
        topic4.average(-90, 89, 78)
Example #13
0
 def test_average_negative_third_input(self):
     with mock.patch('builtins.input', side_effect=[85, 90, -95]):
         with self.assertRaises(ValueError):
             avg.average()
     '''This test checks to see if the average func throws a valueError if the third entry is negative'''
Example #14
0
 def test_average(self):
     self.assertEqual(validation_with_try.average(85, 90, 95), 90)
 def test_average_negative_input_3(self):
     with self.assertRaises(ValueError):
         validation_with_try.average(90, 98, -78)