#NEWLINE# @ mock . patch . object ( vm_utils , '_vdi_resize' ) #NEWLINE# @ mock . patch . object ( vm_utils , '_vdi_get_virtual_size' ) #NEWLINE# def test_update_vdi_virtual_size_raise_if_disk_big( self , mock_get_size , mock_resize ) : #NEWLINE# #INDENT# mock_get_size . return_value = ( ( 1024 ** 3 ) + 1 ) #NEWLINE# instance = { #NEWLINE# #INDENT# 'uuid' : 'a' , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertRaises ( exception . ResizeError , vm_utils . update_vdi_virtual_size , 's' , self , 'ref' , 1 ) #NEWLINE# mock_get_size . assert_called_once_with ( 's' , 'ref' ) #NEWLINE# self . assertFalse ( mock_resize . called )