#NEWLINE# @ mock . patch . object ( processutils , 'ssh_execute' , autospec = True ) #NEWLINE# @ mock . patch . object ( ssh , '_get_hosts_name_for_node' , autospec = True ) #NEWLINE# def test__get_power_status_on_unquoted( self , get_hosts_name_mock , exec_ssh_mock ) : #NEWLINE# #INDENT# info = ssh . _parse_driver_info ( self . node ) #NEWLINE# exec_ssh_mock . return_value = ( 'ExactNodeName' , '' ) #NEWLINE# get_hosts_name_mock . return_value = 'ExactNodeName' #NEWLINE# pstate = ssh . _get_power_status ( self . sshclient , info ) #NEWLINE# ssh_cmd = ( '%s %s' % ( info [ 'cmd_set' ] [ 'base_cmd' ] , info [ 'cmd_set' ] [ 'list_running' ] ) ) #NEWLINE# self . assertEqual ( states . POWER_ON , pstate ) #NEWLINE# exec_ssh_mock . assert_called_once_with ( self . sshclient , ssh_cmd ) #NEWLINE# get_hosts_name_mock . assert_called_once_with ( self . sshclient , info )