#NEWLINE# def test_generate_disks_meta_with_non_zero_size( self ) : #NEWLINE# #INDENT# memory_random_side_effect = [ { #NEWLINE# #INDENT# 'model' : 'Virtual Floppy0' , #NEWLINE# 'name' : 'sde' , #NEWLINE# 'disk' : 'sde' , #NEWLINE# 'size' : 0 , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'model' : 'Virtual HDisk0' , #NEWLINE# 'name' : 'sdf' , #NEWLINE# 'disk' : 'sdf' , #NEWLINE# 'size' : 0 , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'model' : 'TOSHIBA MK1002TS' , #NEWLINE# 'name' : 'sda' , #NEWLINE# 'disk' : 'sda' , #NEWLINE# 'size' : 1000204886016 , #NEWLINE# #UNINDENT# } ] #NEWLINE# with mock . patch ( 'random.choice' , side_effect = memory_random_side_effect ) as mock_random : #NEWLINE# #INDENT# disks_meta = self . generator . _generate_disks_meta ( 1 ) #NEWLINE# self . assertNotEqual ( disks_meta [ 0 ] [ 'size' ] , 0 ) #NEWLINE# self . assertEqual ( mock_random . call_count , 3 )