#NEWLINE# @ mock . patch . object ( vm_utils , 'get_ephemeral_disk_sizes' ) #NEWLINE# def test_ensure_ephemeral_resize_with_root_volume( self , mock_sizes , mock_resize ) : #NEWLINE# #INDENT# mock_sizes . return_value = [ 2000 , 1000 ] #NEWLINE# instance = fake_instance . fake_db_instance ( root_gb = 20 , ephemeral_gb = 20 ) #NEWLINE# ephemerals = { #NEWLINE# #INDENT# '4' : { #NEWLINE# #INDENT# 'ref' : 4 , #NEWLINE# #UNINDENT# } , #NEWLINE# '5' : { #NEWLINE# #INDENT# 'ref' : 5 , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# vdis = { #NEWLINE# #INDENT# 'root' : { #NEWLINE# #INDENT# 'osvol' : True , #NEWLINE# 'ref' : 'vdi_ref' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'ephemerals' : ephemerals , #NEWLINE# #UNINDENT# } #NEWLINE# with mock . patch . object ( vm_utils , 'generate_single_ephemeral' , autospec = True ) as g : #NEWLINE# #INDENT# self . vmops . _resize_up_vdis ( instance , mock_resize ) #NEWLINE# self . assertEqual ( [ mock . call ( self . vmops . _session , instance , 4 , 2000 ) , mock . call ( self . vmops . _session , instance , 5 , 1000 ) ] , mock_resize . call_args_list ) #NEWLINE# self . assertFalse ( g . called )