示例#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!")