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', }
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
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
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
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)
def mkhg_workspace(name): w = Workspace(name) w.storage = u'mercurial' portal.workspace[name] = w
def mkdummywks(name): w = Workspace(name) w.storage = 'dummy_storage' portal.workspace[name] = w
def mkAddWorkspace(self, container, id_): w = Workspace(id_) w.storage = 'dummy_storage' container[id_] = w
def mkhg_workspace(name): w = Workspace(name) w.storage = u'mercurial' w.title = u'' w.description = u'' portal.workspace[name] = w