def test_shell_main(self, mock_shell): mock_shell.side_effect = exc.CommandError("some_message") shell.main() self.assertEqual("some_message\n", sys.stdout.getvalue())
def test_shell_main(self, mock_shell): mock_shell.side_effect = exc.CommandError('some_message') shell.main() self.assertEqual('some_message\n', sys.stdout.getvalue())