Beispiel #1
0
    def setUpPloneSite(self, portal):
        """
        Set up the objects required for the test layer.
        """

        # install pmr2.omex
        #self.applyProfile(portal, 'pmr2.omex:default')

        su = zope.component.getUtility(IStorageUtility, name='dummy_storage')

        su._loadDir('omex_base', join(dirname(__file__), 'omex_base'))
        w = Workspace('omex_base')
        w.storage = 'dummy_storage'
        portal.workspace['omex_base'] = w

        su._loadDir('subrepo', join(dirname(__file__), 'subrepo'))
        w = Workspace('subrepo')
        w.storage = 'dummy_storage'
        portal.workspace['subrepo'] = w

        raw = su._dummy_storage_data['omex_base']
        raw.append({})
        raw[-1].update(raw[2])
        raw[-1]['subrepo'] = {
            '': '_subrepo',
            'rev': '0',
            # XXX note the lack of portal in vhost
            'location': 'http://vhost/workspace/subrepo',
        }
Beispiel #2
0
 def mkhg_workspace(name):
     # XXX temporary method to work with existing tests until
     # this is replaced
     w = Workspace(name)
     w.storage = u'mercurial'
     w.title = u''
     w.description = u''
     self.portal.workspace[name] = w
Beispiel #3
0
 def mkgit_workspace(name):
     # XXX temporary method to work with existing tests until
     # this is replaced
     w = Workspace(name)
     w.storage = u'git'
     w.title = u''
     w.description = u''
     zope.interface.alsoProvides(w, IGitWorkspace)
     self.portal.workspace[name] = w
Beispiel #4
0
 def test_workflow_email_create_nofailure(self):
     # There will be a case where object is created but no transition
     # states will be available.  It should not fail.
     self.settings.wf_change_states = [u'published']
     from pmr2.app.workspace.content import Workspace
     wks = Workspace('wf_mail_test')
     self.portal.workspace['wf_mail_test'] = wks
     wks.notifyWorkflowCreated()
     self.assertEqual(len(self.mailhost.messages), 0)
 def test_workflow_email_create_nofailure(self):
     # There will be a case where object is created but no transition
     # states will be available.  It should not fail.
     self.settings.wf_change_states = [u'published']
     from pmr2.app.workspace.content import Workspace
     wks = Workspace('wf_mail_test')
     self.portal.workspace['wf_mail_test'] = wks
     wks.notifyWorkflowCreated()
     self.assertEqual(len(self.mailhost.messages), 0)
Beispiel #6
0
    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
Beispiel #7
0
    def setUpPloneSite(self, portal):
        self.applyProfile(portal, 'pmr2.virtuoso:default')

        su = zope.component.getUtility(IStorageUtility, name='dummy_storage')
        su._loadDir('virtuoso_test', join(dirname(__file__), 'data'))

        from pmr2.virtuoso.tests.engine import Engine
        zope.component.provideAdapter(Engine())

        w = Workspace('virtuoso_test')
        w.storage = 'dummy_storage' 
        portal.workspace = WorkspaceContainer('workspace')
        portal.workspace['virtuoso_test'] = w

        gs = zope.component.getUtility(IPMR2GlobalSettings)
        self.settings = zope.component.getAdapter(gs, name='pmr2_virtuoso')
        #self.default_client = zope.component.getMultiAdapter(
        #    (portal, self.settings), ISparqlClient)
        sm = portal.getSiteManager()
        #sm.unregisterAdapter(self.default_client, (IPloneSiteRoot, ISettings),
        #    ISparqlClient)
        sm.registerAdapter(DummyPortalSparqlClient,
            (IPloneSiteRoot, ISettings), ISparqlClient)
Beispiel #8
0
 def mkhg_workspace(name):
     w = Workspace(name)
     w.storage = u'mercurial'
     portal.workspace[name] = w
Beispiel #9
0
 def mkdummywks(name):
     w = Workspace(name)
     w.storage = 'dummy_storage'
     portal.workspace[name] = w
Beispiel #10
0
 def mkAddWorkspace(self, container, id_):
     w = Workspace(id_)
     w.storage = 'dummy_storage'
     container[id_] = w
Beispiel #11
0
 def mkhg_workspace(name):
     w = Workspace(name)
     w.storage = u'mercurial'
     w.title = u''
     w.description = u''
     portal.workspace[name] = w