コード例 #1
0
ファイル: layer.py プロジェクト: PMR2/pmr2.omex
 def _create_exposure(rev):
     result = Exposure('combine_test' + rev)
     result.commit_id = unicode(rev)
     result.workspace = u'/plone/workspace/omex_base'
     portal.ec['combine_test' + rev] = result
     result = portal.ec['combine_test' + rev]
     result['demo.xml'] = ExposureFile('demo.xml')
     result['no_omex.xml'] = ExposureFile('no_omex.xml')
コード例 #2
0
ファイル: test_adapters.py プロジェクト: PMR2/pmr2.app
 def setUp(self):
     ExposureUnitTestCase.setUp(self)
     self.portal['exposure'] = ExposureContainer('exposure')
     self.workspace = self.portal.workspace.blank
     tester = Exposure('tester')
     tester.commit_id = u'0'
     tester.workspace = u'/plone/workspace/blank'
     self.portal.exposure['tester'] = tester
     self.exposure = self.portal.exposure['tester']
コード例 #3
0
ファイル: test_browser.py プロジェクト: PMR2/pmr2.rdf
    def setUp(self):
        super(RdfViewDocTestCase, self).setUp()
        self.portal['workspace'] = WorkspaceContainer()
        w = Workspace('rdftest')
        w.storage = 'dummy_storage' 
        self.portal.workspace['rdftest'] = w

        self.portal['exposure'] = ExposureContainer()
        e = Exposure('rdftest')
        e.workspace = u'/plone/workspace/rdftest'
        e.commit_id = u'0'
        self.portal.exposure['rdftest'] = e
        ef = ExposureFile('test.rdf')
        self.portal.exposure.rdftest['test.rdf'] = ef
コード例 #4
0
ファイル: layer.py プロジェクト: PMR2/pmr2.app
    def _mkexposure(self, exposure_root, workspace, commit_id, id_):
        from pmr2.app.exposure.content import ExposureContainer, Exposure
        from pmr2.idgen.interfaces import IIdGenerator

        settings = zope.component.queryUtility(IPMR2GlobalSettings)
        idgen = zope.component.queryUtility(IIdGenerator,
            name=settings.default_exposure_idgen)
        if not id_:
            id_ = idgen.next()
        else:
            # call it anyway.
            idgen.next()
        e = Exposure(id_)
        e.workspace = workspace
        e.commit_id = commit_id
        exposure_root[id_] = e
        exposure_root[id_].reindexObject()
コード例 #5
0
ファイル: layer.py プロジェクト: PMR2/pmr2.virtuoso
    def setUpPloneSite(self, portal):
        from pmr2.app.exposure.content import Exposure
        from pmr2.app.exposure.content import ExposureContainer
        from pmr2.app.exposure.content import ExposureFile

        # Using a separate container because of inability for layers to
        # actually isolate from each other during tearing down when
        # multiple defaultBases (or bases) are used, (especially when
        # running as part of the entire test) and that they
        # somehow persist through tearDown.

        portal['virtuoso_exposure'] = ExposureContainer('virtuoso_exposure')

        e = Exposure('virtuoso_test')
        e.workspace = u'/plone/workspace/virtuoso_test'
        e.commit_id = u'0'
        portal.virtuoso_exposure['virtuoso_test'] = e
        portal.virtuoso_exposure['virtuoso_test'].reindexObject()

        ef = ExposureFile('simple.rdf')
        portal.virtuoso_exposure.virtuoso_test['simple.rdf'] = ef