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

All Samples(18)  |  Call(0)  |  Derive(0)  |  Import(18)

src/p/r/Products.Archetypes-HEAD/Products/Archetypes/tests/test_widgets.py   Products.Archetypes(Download)
 
from Products.Archetypes.tests.atsitetestcase import ATSiteTestCase
from Products.Archetypes.tests.utils import PACKAGE_HOME
from Products.Archetypes.tests.utils import makeContent
from Products.Archetypes.tests.test_fields import FakeRequest
    def afterSetUp(self):
        # XXX messing up with global vars is bad!
        global stub_text_file, stub_text_content, \
               stub_bin_file, stub_bin_content
        stub_text_file = open(os.path.join(PACKAGE_HOME, 'input', 'rest1.rst'))
        stub_text_content = stub_text_file.read()
        stub_text_file.seek(0)
        stub_bin_file = open(os.path.join(PACKAGE_HOME, 'input', 'word.doc'))

src/p/r/Products.Archetypes-HEAD/Products/Archetypes/tests/test_marshaller.py   Products.Archetypes(Download)
from Products.Archetypes.tests.utils import makeContent
from Products.Archetypes.tests.utils import aputrequest
from Products.Archetypes.tests.utils import PACKAGE_HOME
 
from Products.Archetypes.WebDAVSupport import PdataStreamIterator
    def XXX_test_textFieldObjectWordReplace(self):
        #test that uploading to an existing object works
        obj1 = makeContent(self.folder, portal_type='DDocument', id='obj1')
 
        wordFilePath = os.path.join(PACKAGE_HOME, "input", "word.doc")
    def test_textFieldObjectRSTreplace(self):
        ## And again with an RST
        obj1 = makeContent(self.folder, portal_type='DDocument', id='obj1')
 
        rstFilePath = os.path.join(PACKAGE_HOME, "input", "rest1.rst")
    def test_fileFieldObjectWordReplace(self):
        #test that uploading to an existing object works
        obj1 = makeContent(self.folder, portal_type='SimpleFile', id='obj1')
 
        wordFilePath = os.path.join(PACKAGE_HOME, "input", "word.doc")
 
        #now trigger the creation of a content type akin to DAV
        wordFilePath = os.path.join(PACKAGE_HOME, "input", "word.doc")
        wordFile = open(wordFilePath, 'r')
 

src/p/r/Products.Archetypes-HEAD/Products/Archetypes/tests/test_file_upload.py   Products.Archetypes(Download)
 
from Products.Archetypes.atapi import MetadataStorage, BaseContent
from Products.Archetypes.tests.utils import PACKAGE_HOME
 
 

src/p/r/Products.Archetypes-HEAD/Products/Archetypes/tests/test_filename.py   Products.Archetypes(Download)
 
from Products.Archetypes.tests.atsitetestcase import ATSiteTestCase
from Products.Archetypes.tests.utils import PACKAGE_HOME
 
from Products.Archetypes.tests.test_classgen import Dummy
    def test_textfielduploadwithoutfilename(self):
        obj = self._dummy
        file = open(os.path.join(PACKAGE_HOME, 'input', 'rest1.tgz'), 'r')
        field = obj.getField('atextfield')
        obj.setAtextfield(file)
    def test_filefielduploadwithoutfilename(self):
        obj = self._dummy
        file = open(os.path.join(PACKAGE_HOME, 'input', 'rest1.tgz'), 'r')
        field = obj.getField('afilefield')
        obj.setAfilefield(file)
    def afterSetUp(self):
        gen_dummy()
        self._dummy = dummy = Dummy(oid='dummy')
        self._dummy.initializeArchetype()
        file1 = open(os.path.join(PACKAGE_HOME, 'input', 'rest1.tgz'), 'r')
        file2 = open(os.path.join(PACKAGE_HOME, 'input', 'word.doc'), 'r')

src/p/r/Products.Archetypes-HEAD/Products/Archetypes/tests/test_fields.py   Products.Archetypes(Download)
from Products.Archetypes.tests.atsitetestcase import portal_name
from Products.Archetypes.tests.utils import mkDummyInContext
from Products.Archetypes.tests.utils import PACKAGE_HOME
 
from Products.Archetypes.atapi import Schema, DisplayList, IntDisplayList, BaseContentMixin, TextField
    field_instances.append(getattr(at_field, type)(name))
 
txt_file = open(os.path.join(PACKAGE_HOME, 'input', 'rest1.rst'))
txt_content = txt_file.read()
img_file = open(os.path.join(PACKAGE_HOME, 'input', 'tool.gif'), 'rb')
img_content = img_file.read()
animated_gif_file = open(os.path.join(PACKAGE_HOME, 'input', 'animated.gif'), 'rb')
animated_gif_content = animated_gif_file.read()
pdf_file = open(os.path.join(PACKAGE_HOME, 'input', 'webdav.pdf'), 'rb')

src/p/r/Products.Archetypes-HEAD/Products/Archetypes/tests/test_copying.py   Products.Archetypes(Download)
from Products.Archetypes.tests.atsitetestcase import default_user
 
from Products.Archetypes.tests.utils import PACKAGE_HOME
 
 
    def afterSetUp(self):
        ATSiteTestCase.afterSetUp(self)
        self.setRoles(['Manager'])
 
        imgpath = os.path.join(PACKAGE_HOME, os.pardir, 'tool.gif')

src/p/r/Products.Archetypes-HEAD/Products/Archetypes/tests/test_contenttype.py   Products.Archetypes(Download)
 
from Products.Archetypes.tests.atsitetestcase import ATSiteTestCase
from Products.Archetypes.tests.utils import PACKAGE_HOME
 
# this trigger zope imports
    def test_textfielduploadwithoutmime(self):
        obj = self._dummy
        file = open(os.path.join(PACKAGE_HOME, 'input', 'rest1.tgz'), 'r')
        field = obj.getField('atextfield')
        obj.setAtextfield(file)
    def test_filefielduploadwithoutmime(self):
        obj = self._dummy
        file = open(os.path.join(PACKAGE_HOME, 'input', 'rest1.tgz'), 'r')
        field = obj.getField('afilefield')
        obj.setAfilefield(file)
    def afterSetUp(self):
        gen_dummy()
        self._dummy = dummy = Dummy(oid='dummy')
        self._dummy.initializeArchetype()
        file1 = open(os.path.join(PACKAGE_HOME, 'input', 'rest1.tgz'), 'r')
        file2 = open(os.path.join(PACKAGE_HOME, 'input', 'word.doc'), 'r')

src/p/r/Products.Archetypes-HEAD/Products/Archetypes/tests/test_baseunit.py   Products.Archetypes(Download)
 
from Products.Archetypes.tests.atsitetestcase import ATSiteTestCase
from Products.Archetypes.tests.utils import PACKAGE_HOME
from Products.Archetypes.tests.utils import normalize_html
from Products.Archetypes.atapi import BaseUnit
tests = []
 
input_files = glob.glob(os.path.join(PACKAGE_HOME, "input", "rest*.rst"))
for f in input_files:
    fname = os.path.split(f)[1]
    outname = os.path.join(PACKAGE_HOME, "output", '%s.out' % fname.split('.')[0])

src/p/r/Products.Archetypes-1.10.1/Products/Archetypes/tests/test_widgets.py   Products.Archetypes(Download)
 
from Products.Archetypes.tests.atsitetestcase import ATSiteTestCase
from Products.Archetypes.tests.utils import PACKAGE_HOME
from Products.Archetypes.tests.utils import makeContent
from Products.Archetypes.tests.test_fields import FakeRequest
    def afterSetUp(self):
        # XXX messing up with global vars is bad!
        global stub_text_file, stub_text_content, \
               stub_bin_file, stub_bin_content
        stub_text_file = open(os.path.join(PACKAGE_HOME, 'input', 'rest1.rst'))
        stub_text_content = stub_text_file.read()
        stub_text_file.seek(0)
        stub_bin_file = open(os.path.join(PACKAGE_HOME, 'input', 'word.doc'))

src/p/r/Products.Archetypes-1.10.1/Products/Archetypes/tests/test_marshaller.py   Products.Archetypes(Download)
from Products.Archetypes.tests.utils import makeContent
from Products.Archetypes.tests.utils import aputrequest
from Products.Archetypes.tests.utils import PACKAGE_HOME
 
from Products.Archetypes.WebDAVSupport import PdataStreamIterator
    def XXX_test_textFieldObjectWordReplace(self):
        #test that uploading to an existing object works
        obj1 = makeContent(self.folder, portal_type='DDocument', id='obj1')
 
        wordFilePath = os.path.join(PACKAGE_HOME, "input", "word.doc")
    def test_textFieldObjectRSTreplace(self):
        ## And again with an RST
        obj1 = makeContent(self.folder, portal_type='DDocument', id='obj1')
 
        rstFilePath = os.path.join(PACKAGE_HOME, "input", "rest1.rst")
    def test_fileFieldObjectWordReplace(self):
        #test that uploading to an existing object works
        obj1 = makeContent(self.folder, portal_type='SimpleFile', id='obj1')
 
        wordFilePath = os.path.join(PACKAGE_HOME, "input", "word.doc")
 
        #now trigger the creation of a content type akin to DAV
        wordFilePath = os.path.join(PACKAGE_HOME, "input", "word.doc")
        wordFile = open(wordFilePath, 'r')
 

  1 | 2  Next