def test_multicondition_is_even_steven(self): user_input = [200004] expected_output = "Even Steven!" with patch('builtins.input', side_effect=user_input): with patch('sys.stdout', new=StringIO()) as fake_out: target.multi_condition() output = fake_out.getvalue().strip('\n') self.assertEqual(output, expected_output)
def test_multicondition_is_negative(self): user_input = [-3] expected_output = "Negative Nelly!" with patch('builtins.input', side_effect=user_input): with patch('sys.stdout', new=StringIO()) as fake_out: target.multi_condition() output = fake_out.getvalue().strip('\n') self.assertEqual(output, expected_output)
def test_multicondition_is_zero(self): user_input = [0] expected_output = "Don't be such a zero!" with patch('builtins.input', side_effect=user_input): with patch('sys.stdout', new=StringIO()) as fake_out: target.multi_condition() output = fake_out.getvalue().strip('\n') self.assertEqual(output, expected_output)