def test_add_grades_normal(self,mock_input): self.assertEqual([80, 90, 100], crud.add_grades())
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)
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)
def test_add_grades_one_invalid_above_100(self, mock_input): self.assertEqual([80, 90], crud.add_grades())
def test_add_grades_empty_list(self, mock_input): self.assertEqual([], crud.add_grades())