Esempio n. 1
0
 def setUp(self):
     setup.placelessSetUp()
     provideAdapter(GenericValue)
     provideAdapter(FrobRenderer)
     provideAdapter(StructRenderer)
     provideAdapter(DictValue)
     self.addTypeEqualityFunc(str, 'assertMultiLineEqual')
Esempio n. 2
0
 def setUp(self):
     setup.placelessSetUp()
     provideUtility(FakeServerType(), name='FAKE')
     self.options = Options()
     self.options.server_type = 'FAKE'
     self.options.verbose = False
     self.db = None
Esempio n. 3
0
 def setUp(self):
     setup.placelessSetUp()
     provideAdapter(GenericValue)
     provideAdapter(FrobRenderer)
     provideAdapter(StructRenderer)
     provideAdapter(DictValue)
     self.addTypeEqualityFunc(str, 'assertMultiLineEqual')
Esempio n. 4
0
 def setUp(self):
     setup.placelessSetUp()
     provideUtility(FakeServerType(), name='FAKE')
     self.options = Options()
     self.options.server_type = 'FAKE'
     self.options.verbose = False
     self.db = None
Esempio n. 5
0
 def setUp(self):
     setup.placelessSetUp()
     bucket = OOBucket()
     bucket[1] = 42
     bucket[2] = 23
     bucket[3] = 17
     state = bucket.__getstate__()
     self.state = OOBucketState(None, state, None)
Esempio n. 6
0
 def setUp(self):
     setup.placelessSetUp()
     bucket = OOBucket()
     bucket[1] = 42
     bucket[2] = 23
     bucket[3] = 17
     state = bucket.__getstate__()
     self.state = OOBucketState(None, state, None)
Esempio n. 7
0
 def setUp(self):
     setup.placelessSetUp()
     provideAdapter(GenericState)
     provideAdapter(ZodbObjectHistory)
     RealDatabaseTest.setUp(self)
     self.obj = self.conn.root()['obj'] = SampleFolder()
     self.named_obj = self.conn.root()['named_obj'] = NamedSampleFolder()
     transaction.commit()
Esempio n. 8
0
def setUp(test=None):
    """Set up for schooltool.relationship doctests.

    Calls Zope's placelessSetUp, sets up annotations and relationships.
    """
    setup.placelessSetUp()
    setup.setUpAnnotations()
    setUpRelationships()
Esempio n. 9
0
def setUp(test=None):
    """Set up for schooltool.relationship doctests.

    Calls Zope's placelessSetUp, sets up annotations and relationships.
    """
    setup.placelessSetUp()
    setup.setUpAnnotations()
    setUpRelationships()
Esempio n. 10
0
 def setUp(self):
     setup.placelessSetUp()
     provideAdapter(ZodbObjectHistory)
     provideAdapter(OOBTreeHistory)
     RealDatabaseTest.setUp(self)
     self.tree = self.conn.root()['tree'] = OOBTree()
     for i in range(0, 100):
         self.tree[i] = i
         transaction.commit()
Esempio n. 11
0
 def setUp(self):
     setup.placelessSetUp()
     provideAdapter(ZodbObjectHistory)
     tree = OOBTree()
     tree[1] = 42
     tree[2] = 23
     tree[3] = 17
     state = tree.__getstate__()
     self.state = EmptyOOBTreeState(None, state, None)
Esempio n. 12
0
 def setUp(self):
     setup.placelessSetUp()
     provideAdapter(ZodbObjectHistory)
     tree = OOBTree()
     tree[1] = 42
     tree[2] = 23
     tree[3] = 17
     state = tree.__getstate__()
     self.state = EmptyOOBTreeState(None, state, None)
Esempio n. 13
0
 def setUp(self):
     setup.placelessSetUp()
     provideAdapter(ZodbObjectHistory)
     provideAdapter(OOBTreeHistory)
     RealDatabaseTest.setUp(self)
     self.tree = self.conn.root()['tree'] = OOBTree()
     for i in range(0, 100):
         self.tree[i] = i
         transaction.commit()
Esempio n. 14
0
 def setUp(self):
     setup.placelessSetUp()
     provideAdapter(GenericState)
     RealDatabaseTest.setUp(self)
     self.obj = self.conn.root()['obj'] = SampleFolder()
     alsoProvides(self.obj, IMyInterface, IMyGoodInterface)
     sys.modules['zodbbrowser.nosuchmodule'] = sys.modules[__name__]
     transaction.commit()
     sys.modules.pop('zodbbrowser.nosuchmodule', None)
     install_provides_hack()
 def setUp(self):
     setup.placelessSetUp()
     provideAdapter(OOBTreeState)
     provideAdapter(ZodbObjectHistory)
     RealDatabaseTest.setUp(self)
     self.folder = self.conn.root()['folder'] = Folder()
     self.folder['foo'] = 1
     self.folder['bar'] = 2
     transaction.commit()
     self.state = FolderState(None, self.folder.__getstate__(), None)
Esempio n. 16
0
def setUp(test):
    setup.placelessSetUp(True)
    setup.setUpTestAsModule(test, name='zojax.workflow.TESTS')

    component.provideAdapter(state.WorkflowState)
    component.provideAdapter(info.WorkflowInfo)
    component.provideHandler(workflow.initWorkflow)
    component.provideAdapter(AttributeAnnotations)
    component.provideAdapter(state.contentPermissionsMap,
                             name='workflow.state.permissions')
Esempio n. 17
0
 def setUp(self):
     setup.placelessSetUp()
     provideAdapter(ZodbObjectHistory)
     RealDatabaseTest.setUp(self)
     self.root = self.conn.root()['root'] = Root()
     self.foo = self.root['foo'] = SampleFolder()
     self.bar = self.root['foo']['bar'] = SampleFolder()
     transaction.commit()
     self.foo.__name__ = 'new'
     transaction.commit()
Esempio n. 18
0
 def setUp(self):
     setup.placelessSetUp()
     provideAdapter(ZodbObjectHistory)
     RealDatabaseTest.setUp(self)
     self.root = self.conn.root()['root'] = Root()
     self.foo = self.root['foo'] = SampleFolder()
     self.bar = self.root['foo']['bar'] = SampleFolder()
     transaction.commit()
     self.foo.__name__ = 'new'
     transaction.commit()
Esempio n. 19
0
 def setUp(self):
     setup.placelessSetUp()
     provideAdapter(GenericState)
     provideAdapter(ZodbObjectHistory)
     RealDatabaseTest.setUp(self)
     self.obj = self.conn.root()['obj'] = SampleFolder()
     self.named_obj = self.conn.root()['named_obj'] = NamedSampleFolder()
     self.root = self.conn.root()['application'] = Root()
     self.child = self.root['child'] = SampleFolder()
     transaction.commit()
Esempio n. 20
0
 def setUp(self):
     setup.placelessSetUp()
     provideAdapter(GenericState)
     RealDatabaseTest.setUp(self)
     self.obj = self.conn.root()['obj'] = SampleFolder()
     alsoProvides(self.obj, IMyInterface, IMyGoodInterface)
     sys.modules['zodbbrowser.nosuchmodule'] = sys.modules[__name__]
     transaction.commit()
     sys.modules.pop('zodbbrowser.nosuchmodule', None)
     install_provides_hack()
Esempio n. 21
0
 def setUp(self):
     setup.placelessSetUp()
     provideAdapter(OOBTreeState)
     provideAdapter(ZodbObjectHistory)
     RealDatabaseTest.setUp(self)
     self.container = self.conn.root()['container'] = BTreeContainer()
     self.container['foo'] = 1
     self.container['bar'] = 2
     transaction.commit()
     self.state = BTreeContainerState(None, self.container.__getstate__(),
                                      None)
Esempio n. 22
0
 def setUp(self):
     setup.placelessSetUp()
     provideAdapter(ZodbObjectHistory)
     RealDatabaseTest.setUp(self)
     self.container = self.conn.root()['container'] = OrderedContainer()
     self.container['foo'] = 1
     self.container['bar'] = 2
     transaction.commit()
     self.tid = self.container._p_serial
     self.state = OrderedContainerState(self.container,
                                        self.container.__getstate__(),
                                        self.tid)
Esempio n. 23
0
 def setUp(self):
     setup.placelessSetUp()
     provideAdapter(ZodbObjectHistory)
     provideAdapter(PersistentDictState)
     provideAdapter(PersistentMappingState)
     RealDatabaseTest.setUp(self)
     self.container = self.conn.root()['container'] = SampleFolder()
     self.container['foo'] = 1
     self.container['bar'] = 2
     transaction.commit()
     self.state = SampleContainerState(None, self.container.__getstate__(),
                                       None)
Esempio n. 24
0
 def setUp(self):
     setup.placelessSetUp()
     provideAdapter(ZodbObjectHistory)
     RealDatabaseTest.setUp(self)
     self.tree = self.conn.root()['tree'] = OOBTree()
     for i in range(0, 1000):
         self.tree[i] = -1
     transaction.commit()
     for i in range(0, 1000, 2):
         self.tree[i] = 1
     transaction.commit()
     self.tids = [d['tid'] for d in IObjectHistory(self.tree)]
Esempio n. 25
0
 def setUp(self):
     setup.placelessSetUp()
     provideAdapter(ZodbObjectHistory)
     provideAdapter(PersistentDictState)
     provideAdapter(PersistentMappingState)
     RealDatabaseTest.setUp(self)
     self.container = self.conn.root()['container'] = SampleFolder()
     self.container['foo'] = 1
     self.container['bar'] = 2
     transaction.commit()
     self.state = SampleContainerState(None, self.container.__getstate__(),
                                       None)
Esempio n. 26
0
def setUpSecurityDirectives(test=None):
    setup.placelessSetUp()
    zcml = ZCMLWrapper()
    zcml.include('schooltool.common', file='zcmlfiles.zcml')
    zcml.include('schooltool.securitypolicy', file='meta.zcml')
    zcml.include('schooltool.securitypolicy')
    zcml.setUp(namespaces={
        "": "http://namespaces.zope.org/zope",
        "security": "http://schooltool.org/securitypolicy"
    },
               i18n_domain='schooltool')
    test.globs['zcml'] = zcml
Esempio n. 27
0
 def setUp(self):
     setup.placelessSetUp()
     provideAdapter(ZodbObjectHistory)
     RealDatabaseTest.setUp(self)
     self.container = self.conn.root()['container'] = OrderedContainer()
     self.container['foo'] = 1
     self.container['bar'] = 2
     transaction.commit()
     self.tid = self.container._p_serial
     self.state = OrderedContainerState(self.container,
                                        self.container.__getstate__(),
                                        self.tid)
Esempio n. 28
0
    def setUp(self):
        super(TestLockStorage, self).setUp()
        setup.placelessSetUp()
        zope.security.management.endInteraction()

        ztapi.provideAdapter(Interface, IKeyReference, FakeKeyReference)
        ztapi.provideAdapter(Interface, ILockable, LockingAdapterFactory)
        ztapi.provideAdapter(None, IPathAdapter, LockingPathAdapter, "locking")

        self.storage = storage = PersistentLockStorage()
        ztapi.provideUtility(ILockStorage, storage)
        ztapi.provideUtility(ILockTracker, storage)
Esempio n. 29
0
 def setUp(self):
     setup.placelessSetUp()
     provideAdapter(ZodbObjectHistory)
     RealDatabaseTest.setUp(self)
     self.tree = self.conn.root()['tree'] = OOBTree()
     for i in range(0, 1000):
         self.tree[i] = -1
     transaction.commit()
     for i in range(0, 1000, 2):
         self.tree[i] = 1
     transaction.commit()
     self.tids = [d['tid'] for d in IObjectHistory(self.tree)]
Esempio n. 30
0
def setUp(test):
    setup.placelessSetUp()
    from z3c.form import testing
    testing.setupFormDefaults()
    vr = getVocabularyRegistry()
    from schooltool.basicperson.vocabularies import groupVocabularyFactory
    from schooltool.basicperson.vocabularies import advisorVocabularyFactory
    vr.register('schooltool.basicperson.group_vocabulary',
                groupVocabularyFactory())
    vr.register('schooltool.basicperson.advisor_vocabulary',
                advisorVocabularyFactory())
    setUpRelationships()
    setUpAnnotations()
Esempio n. 31
0
def setUp(test):
    setup.placelessSetUp()
    from z3c.form import testing
    testing.setupFormDefaults()
    vr = getVocabularyRegistry()
    from schooltool.basicperson.vocabularies import groupVocabularyFactory
    from schooltool.basicperson.vocabularies import advisorVocabularyFactory
    vr.register('schooltool.basicperson.group_vocabulary',
                groupVocabularyFactory())
    vr.register('schooltool.basicperson.advisor_vocabulary',
                advisorVocabularyFactory())
    setUpRelationships()
    setUpAnnotations()
Esempio n. 32
0
def setUpSecurityDirectives(test=None):
    setup.placelessSetUp()
    zcml = ZCMLWrapper()
    zcml.include('schooltool.common', file='zcmlfiles.zcml')
    zcml.include('schooltool.securitypolicy', file='meta.zcml')
    zcml.include('schooltool.securitypolicy')
    zcml.setUp(
        namespaces={
            "": "http://namespaces.zope.org/zope",
            "security": "http://schooltool.org/securitypolicy"
            },
        i18n_domain='schooltool')
    test.globs['zcml'] = zcml
Esempio n. 33
0
def setUp(test):
    setup.placelessSetUp()

    provideUtility(r1, name='r1')
    provideUtility(r2, name='r2')
    provideUtility(r3, name='r3')

    provideUtility(p1, name='my.p1')
    provideUtility(p2, name='my.p2')
    provideUtility(p3, name='my.p3')

    provideAdapter(AttributeAnnotations)
    provideAdapter(ObjectPermissionsMaps)
    provideAdapter(ObjectPermissionsMapsManager)
    provideAdapter(PermissionsMapManager,
                   (interface.Interface,), name='zojax.permissionsmap')
Esempio n. 34
0
def setUp(test):
    setup.placelessSetUp()
    setUpContents()

    provideUtility(Auth())
    provideAdapter(Ownership)
    provideAdapter(manager.getPersonalSpace)
    provideHandler(manager.personalSpaceMoved)
    provideHandler(manager.principalRemovingHandler)
    provideUtility(manager.PersonalSpaceService(), name="zojax.personal.space")

    provideAdapter(ObjectMover)
    provideAdapter(ContainerItemRenamer)

    interface.classImplements(space.PersonalSpace, IOwnerAware)

    global oldMethod
    oldMethod = utils.checkPermissionForPrincipal.func_code
    utils.checkPermissionForPrincipal.func_code = checkPermissionForPrincipal.func_code
Esempio n. 35
0
 def setUp(self):
     setup.placelessSetUp()
     provideAdapter(ZodbObjectHistory)
Esempio n. 36
0
def setUp(test):
    setup.placelessSetUp()
    provideAdapter(SimpleValueRenderer)
Esempio n. 37
0
def setUp(test=None):
    setup.placelessSetUp()
def setUp(test):
    setup.placelessSetUp(test)
    test.generate = facility.LocalKeyManagementFacility.generate
    facility.LocalKeyManagementFacility.generate = lambda s: b'foo'
Esempio n. 39
0
 def setUp(self):
     setup.placelessSetUp()
     provideAdapter(SimpleValueRenderer)
     self.attribute = ZodbObjectAttribute('foo', 42L, 't565')
Esempio n. 40
0
 def setUp(self):
     setup.placelessSetUp()
     provideAdapter(GenericValue)
     provideAdapter(FrobRenderer)
     provideAdapter(StructRenderer)
Esempio n. 41
0
def setUp(test=None):
    setup.placelessSetUp()
Esempio n. 42
0
def setUp(test=None):
    setup.placelessSetUp()
    test.globs['__policy'] = setSecurityPolicy(SecurityPolicy)
    endInteraction()
    newInteraction()
Esempio n. 43
0
 def setUp(self):
     setup.placelessSetUp()
     RealDatabaseTest.setUp(self)
Esempio n. 44
0
def setUp(test):
    setup.placelessSetUp()
    setup.setUpTraversal()
Esempio n. 45
0
def setUp(test):
    placelessSetUp()
Esempio n. 46
0
def setUp(test):
    setup.placelessSetUp()
    provideAdapter(SimpleValueRenderer)
Esempio n. 47
0
def setUp(test):
    setup.placelessSetUp()
    ztapi.browserViewProviding(ITextLine, TextWidget, IInputWidget)
    ztapi.browserViewProviding(IWidgetInputError, WidgetInputErrorView,
                               IWidgetInputErrorView)
Esempio n. 48
0
def setUp(test=None):
    setup.placelessSetUp()
    provideUtility(object(), IIntIds)
Esempio n. 49
0
def setUpPersistent(test):
    setup.setUpTestAsModule(test, name='keas.kmi.tests.doctestfile')
    setup.placelessSetUp()
    provideUtility(TestingKeyManagementFacility(tempfile.mkdtemp()),
                   provides=IKeyManagementFacility)
Esempio n. 50
0
def setUp(test):
    setup.placelessSetUp()
    setup.setUpAnnotations()
Esempio n. 51
0
 def setUp(self):
     setup.placelessSetUp()
     provideAdapter(ZodbObjectHistory)
Esempio n. 52
0
 def setUp(self):
     setup.placelessSetUp()
     provideAdapter(SimpleValueRenderer)
     self.attribute = ZodbObjectAttribute('foo', 42, 't565')
Esempio n. 53
0
def setUp(test):
    setup.placelessSetUp()
    setup.setUpTraversal()
    setSite()
Esempio n. 54
0
def setUp(test=None):
    setup.placelessSetUp()
    test.globs['__policy'] = setSecurityPolicy(SecurityPolicy)
    endInteraction()
    newInteraction()
Esempio n. 55
0
 def setUp(self, test=None):
     setup.placelessSetUp()
     self.oldRegisterCrowdAdapter = mc.registerCrowdAdapter
Esempio n. 56
0
def setUp(test=None):
    setup.placelessSetUp()
    provideUtility(object(), IIntIds)
Esempio n. 57
0
def setUp(test):
    setup.placelessSetUp()
    setUpTraversing()
    component.provideAdapter(getSession)
    component.provideAdapter(message.StatusMessage, name='statusMessage')
    component.provideUtility(RAMSessionDataContainer(), ISessionDataContainer)
Esempio n. 58
0
def setUp(test):
    setup.placelessSetUp()
Esempio n. 59
0
def setUp(test):
    setup.placelessSetUp()
    setup.setUpAnnotations()
    setUpRelationships()
Esempio n. 60
0
 def setUp(self):
     setup.placelessSetUp()
     provideAdapter(GenericValue)
     provideAdapter(PersistentValue)