#NEWLINE# def test_async_command_failure( self ) : #NEWLINE# #INDENT# result = base . AsyncCommandResult ( 'foo_command' , { #NEWLINE# #INDENT# 'fail' : True , #NEWLINE# #UNINDENT# } , foo_execute ) #NEWLINE# expected_result = { #NEWLINE# #INDENT# 'id' : result . id , #NEWLINE# 'command_name' : 'foo_command' , #NEWLINE# 'command_params' : { #NEWLINE# #INDENT# 'fail' : True , #NEWLINE# #UNINDENT# } , #NEWLINE# 'command_status' : 'RUNNING' , #NEWLINE# 'command_result' : None , #NEWLINE# 'command_error' : None , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertEqualEncoded ( expected_result , result ) #NEWLINE# result . start ( ) #NEWLINE# result . join ( ) #NEWLINE# expected_result [ 'command_status' ] = 'FAILED' #NEWLINE# expected_result [ 'command_error' ] = errors . CommandExecutionError ( str ( EXPECTED_ERROR ) ) #NEWLINE# self . assertEqualEncoded ( expected_result , result )