#NEWLINE# @ mock . patch . object ( vm_utils , '_count_children' ) #NEWLINE# @ mock . patch . object ( greenthread , 'sleep' ) #NEWLINE# def test_wait_for_vhd_coalesce_parent_snapshot( self , mock_sleep , mock_count ) : #NEWLINE# #INDENT# mock_count . return_value = 2 #NEWLINE# instance = { #NEWLINE# #INDENT# 'uuid' : 'fake' , #NEWLINE# #UNINDENT# } #NEWLINE# vm_utils . _wait_for_vhd_coalesce ( 'session' , instance , 'sr_ref' , 'vdi_ref' , [ 'uuid1' , 'uuid2' ] ) #NEWLINE# self . assertFalse ( mock_sleep . called ) #NEWLINE# self . assertTrue ( instance . called )