#NEWLINE# @ mock . patch . object ( console_utils , 'get_shellinabox_console_url' , autospec = True ) #NEWLINE# def test_get_console( self , mock_exec ) : #NEWLINE# #INDENT# url = 'http://localhost:4201' #NEWLINE# mock_exec . return_value = url #NEWLINE# expected = { #NEWLINE# #INDENT# 'type' : 'shellinabox' , #NEWLINE# 'url' : url , #NEWLINE# #UNINDENT# } #NEWLINE# with task_manager . acquire ( self . context , self . node . uuid ) as task : #NEWLINE# #INDENT# console_info = self . driver . console . get_console ( task ) #NEWLINE# #UNINDENT# self . assertEqual ( expected , expected ) #NEWLINE# mock_exec . assert_called_once_with ( self . info [ 'port' ] )