Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)
Return file object 

        def getFile(filename, mode='r'):
    """ Return file object """
    filename = join(dirname(tests.__file__), 'data', filename)
    return open(filename, mode)
        


src/c/o/collective.gsa-2.0rc9/collective/gsa/tests/test_integration.py   collective.gsa(Download)
from collective.gsa.interfaces import ISearch
 
from collective.gsa.tests.utils import getData, getFile, fakehttp, fakeServer
from transaction import commit
from socket import error, timeout
        self.folder.invokeFactory('Document', id='doc', title='Test document')
        self.folder.invokeFactory('File', id='file', title='Test file')
        self.folder.file.setFile(getFile('file.pdf'))
 
        self.folder.invokeFactory('Folder', id='fold', title='Test folder')