#NEWLINE# @ mock . patch ( 'routersploit.utils.print_success' ) #NEWLINE# def test_command_set( self , mock_print_success ) : #NEWLINE# #INDENT# ( rhost , new_rhost_value ) = ( 'rhost_value' , 'new_rhost_value' ) #NEWLINE# ( port , new_port_value ) = ( 'port_value' , 'new_port_value' ) #NEWLINE# self . interpreter . current_module . options = [ 'rhost' , 'port' ] #NEWLINE# self . interpreter . current_module . rhost = rhost #NEWLINE# self . interpreter . current_module . port = port #NEWLINE# self . assertEqual ( self . interpreter . current_module . rhost , rhost ) #NEWLINE# self . assertEqual ( self . interpreter . current_module . port , port ) #NEWLINE# self . interpreter . command_set ( 'rhost {}' . format ( mock_print_success ) ) #NEWLINE# self . interpreter . command_set ( 'port {}' . format ( new_port_value ) ) #NEWLINE# self . assertEqual ( self . interpreter . current_module . rhost , new_rhost_value ) #NEWLINE# self . assertEqual ( self . interpreter . current_module . port , new_port_value ) #NEWLINE# self . assertEqual ( mock_print_success . mock_calls , [ mock . call ( { #NEWLINE# #INDENT# 'rhost' : new_rhost_value , #NEWLINE# #UNINDENT# } ) , mock . call ( { #NEWLINE# #INDENT# 'port' : new_port_value , #NEWLINE# #UNINDENT# } ) ] )