#NEWLINE# @ mock . patch ( 'os.path.exists' , return_value = True ) #NEWLINE# @ mock . patch ( 'nova.utils.execute' ) #NEWLINE# def test_create_cow_image( self , mock_execute , mock_exists ) : #NEWLINE# #INDENT# mock_execute . return_value = ( 'stdout' , None ) #NEWLINE# libvirt_utils . create_cow_image ( '/some/path' , '/the/new/cow' ) #NEWLINE# expected_args = [ ( ( 'env' , 'LC_ALL=C' , 'LANG=C' , 'qemu-img' , 'info' , '/some/path' ) , ) , ( ( 'qemu-img' , 'create' , '-f' , 'qcow2' , '-o' , 'backing_file=/some/path' , '/the/new/cow' ) , ) ] #NEWLINE# self . assertEqual ( mock_execute , mock_execute . call_args_list )