#NEWLINE# def _run_command_compare_to_string( self , command , exit_status , stdout_text = None , stderr_text = None ) : #NEWLINE# #INDENT# '\n            Compares stdout from the CLI to the given string\n        ' #NEWLINE# try : #NEWLINE# #INDENT# main . parse_and_validate_commands ( command ) #NEWLINE# #UNINDENT# except SystemExit as e : #NEWLINE# #INDENT# self . assertEqual ( e . code , exit_status ) #NEWLINE# #UNINDENT# if ( stdout_text is not None ) : #NEWLINE# #INDENT# actual = self . test_stdout . getvalue ( ) #NEWLINE# self . assertEqual ( stdout_text , actual , self . _format_expected_actual ( stdout_text , actual ) ) #NEWLINE# #UNINDENT# if ( stderr_text is not None ) : #NEWLINE# #INDENT# actual = self . test_stderr . getvalue ( ) #NEWLINE# self . assertEqual ( stderr_text , self . test_stderr . getvalue ( ) , self . _format_expected_actual ( exit_status , actual ) )