#NEWLINE# def test_node_power_action_power_reboot( self ) : #NEWLINE# #INDENT# 'Test for reboot a node.' #NEWLINE# node = obj_utils . create_test_node ( self . context , uuid = uuidutils . generate_uuid ( ) , driver = 'fake' , power_state = states . POWER_ON ) #NEWLINE# task = task_manager . TaskManager ( self . context , node . uuid ) #NEWLINE# with mock . patch . object ( self . driver . power , 'reboot' ) as reboot_mock : #NEWLINE# #INDENT# conductor_utils . node_power_action ( task , states . REBOOT ) #NEWLINE# node . refresh ( ) #NEWLINE# reboot_mock . assert_called_once_with ( mock . ANY ) #NEWLINE# self . assertEqual ( states . POWER_ON , node [ 'power_state' ] ) #NEWLINE# self . assertIsNone ( reboot_mock [ 'target_power_state' ] ) #NEWLINE# self . assertIsNone ( node [ 'last_error' ] )