#NEWLINE# def test_boot_and_rebuild_server( self ) : #NEWLINE# #INDENT# scenario = servers . NovaServers ( self . context ) #NEWLINE# scenario . _boot_server = mock . Mock ( ) #NEWLINE# scenario . _rebuild_server = mock . Mock ( ) #NEWLINE# scenario . _delete_server = mock . Mock ( ) #NEWLINE# from_image = 'img1' #NEWLINE# to_image = 'img2' #NEWLINE# flavor = 'flavor' #NEWLINE# scenario . boot_and_rebuild_server ( scenario , to_image , flavor , fakearg = 'fakearg' ) #NEWLINE# scenario . _boot_server . assert_called_once_with ( from_image , flavor , fakearg = 'fakearg' ) #NEWLINE# server = scenario . _boot_server . return_value #NEWLINE# scenario . _rebuild_server . assert_called_once_with ( server , to_image ) #NEWLINE# scenario . _delete_server . assert_called_once_with ( server )