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

All Samples(8)  |  Call(5)  |  Derive(0)  |  Import(3)

src/a/r/archetypes.schemaextender-2.1.3/archetypes/schemaextender/benchmark.py   archetypes.schemaextender(Download)
from zope.component import getGlobalSiteManager
from archetypes.schemaextender.extender import cachingInstanceSchemaFactory
from archetypes.schemaextender.extender import instanceSchemaFactory
from archetypes.schemaextender.interfaces import IExtensible
from archetypes.schemaextender.tests.mocks import ExtensibleType

src/a/r/archetypes.schemaextender-2.1.3/archetypes/schemaextender/tests/testSchemaFactory.py   archetypes.schemaextender(Download)
import unittest
from archetypes.schemaextender.extender import instanceSchemaFactory
from archetypes.schemaextender.tests.case import TestCase
from archetypes.schemaextender.tests.mocks import Extender
from archetypes.schemaextender.tests.mocks import OrderableExtender
    def testNoExtenderMeansNoChanges(self):
        schema=instanceSchemaFactory(self.instance)
        self.assertTrue(schema is self.instance.schema)
 
 
    def testNopExtender(self):
        schema=instanceSchemaFactory(self.instance)
        self.assertEqual(schema.signature(), self.instance.schema.signature())
 
    def testExtendWithSingleField(self):
        Extender.fields=[MockField()]
        schema=instanceSchemaFactory(self.instance)
    def testExtendTwiceCreateOnce(self):
        Extender.fields=[MockField(), MockField()]
        schema=instanceSchemaFactory(self.instance)
        self.assertEqual(schema.keys().count("MockField"), 1)
 

src/a/r/archetypes.schemaextender-2.1.3/archetypes/schemaextender/tests/case.py   archetypes.schemaextender(Download)
import unittest
from zope.interface import implements
from zope.component import provideAdapter
from zope.component import getGlobalSiteManager
from archetypes.schemaextender.extender import instanceSchemaFactory