예제 #1
0
 def test_score_input_invalid_message(self):
     score_input("Hello World", -20, "oops")
예제 #2
0
 def test_score_input_test_score_above_range(self):
     score_input("Benjamin Franklin", 106)
예제 #3
0
 def test_test_score_non_numeric(self):
     try:
         score_input("Test", "hello")
     except:
         print("Bad input")
예제 #4
0
 def test_score_input_test_score_valid(self):
     score_input("Tanner Babcock", 90)
예제 #5
0
 def test_score_input_test_score_below_range(self):
     score_input("John Smith", -5)
 def test_score_input_test_score_valid(self):
     self.assertTrue(score_input("hello", 33) == {'hello': 33})
     self.assertTrue(score_input("fred", 77) == {'fred': 77})
예제 #7
0
 def test_score_input_test_name(self):
     score_input("Tanner Babcock")
 def test_score_input_invalid_message(self):
     self.assertTrue(
         score_input("hello", "&^*D&", "something is wrong") ==
         'something is wrong')
 def test_score_input_test_name(self):
     self.assertTrue(score_input("hello") == {'hello': 0})
     self.assertTrue(score_input("fred") == {'fred': 0})
 def test_score_input_test_score_above_range(self):
     self.assertTrue(
         score_input("hello", 155) == 'Invalid test score, try again!')
 def test_test_score_non_numeric(self):
     self.assertTrue(
         score_input("hello", "&^*D&") == 'Invalid test score, try again!')
예제 #12
0
 def test_score_input_test_score_valid(self):
     self.assertEqual(validate_input_in_functions.score_input("math", 92),
                      "math: 92")
예제 #13
0
 def test_score_input_test_name(self):
     self.assertEqual(validate_input_in_functions.score_input("math"),
                      "math: 0")
예제 #14
0
 def test_score_input_invalid_message(self):
     self.assertEqual(
         validate_input_in_functions.score_input(
             "math", 92, "Invalid test score, try again!"), "math: 92")
예제 #15
0
 def test_test_score_non_numeric(self):
     with self.assertRaises(TypeError):
         validate_input_in_functions.score_input("math", "math")
예제 #16
0
 def test_score_input_test_score_above_range(self):
     self.assertEqual(validate_input_in_functions.score_input("math", 192),
                      "Invalid test score, try again!")