Beispiel #1
0
 def test_add_grades_normal(self,mock_input):
     self.assertEqual([80, 90, 100], crud.add_grades())
Beispiel #2
0
 def test_add_grades_one_invalid_input(self, mock_stdout, mock_input):
     crud.add_grades()
     expected = 'Grade must be an integer\n'
     self.assertEqual(mock_stdout.getvalue(), expected)
Beispiel #3
0
 def test_add_grades_one_invalid_printed(self, mock_stdout, mock_input):
     expected = 'That grade is not valid\n'
     crud.add_grades()
     self.assertEqual(mock_stdout.getvalue(), expected)
Beispiel #4
0
 def test_add_grades_one_invalid_above_100(self, mock_input):
     self.assertEqual([80, 90], crud.add_grades())
Beispiel #5
0
 def test_add_grades_empty_list(self, mock_input):
     self.assertEqual([], crud.add_grades())