[Checkins] SVN: grokcore.catalog/trunk/s Fixed tests

Souheil Chelfouh cvs-admin at zope.org
Sun Apr 29 09:38:04 UTC 2012


Log message for revision 125367:
  Fixed tests
  

Changed:
  U   grokcore.catalog/trunk/setup.py
  U   grokcore.catalog/trunk/src/grokcore/catalog/__init__.py
  U   grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/catalog.py
  U   grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes.py
  U   grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_app_interface.py
  U   grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_attribute.py
  U   grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_class.py
  U   grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_multiple.py
  U   grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_multiple_conflict.py
  U   grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_name.py
  U   grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_nonexistent.py
  U   grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_set.py
  U   grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_site.py
  U   grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_valueindex.py
  U   grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/setuporder.py
  U   grokcore.catalog/trunk/src/grokcore/catalog/ftests/test_grok_functional.py
  U   grokcore.catalog/trunk/src/grokcore/catalog/tests/catalog/indexes_no_app.py

-=-
Modified: grokcore.catalog/trunk/setup.py
===================================================================
--- grokcore.catalog/trunk/setup.py	2012-04-29 07:47:07 UTC (rev 125366)
+++ grokcore.catalog/trunk/setup.py	2012-04-29 09:38:00 UTC (rev 125367)
@@ -12,6 +12,7 @@
     read('README.txt') + '\n' + read('CHANGES.txt'))
 
 tests_require = [
+    'grokcore.content',
     'zope.app.appsetup',
     'zope.component',
     'zope.configuration',
@@ -42,13 +43,21 @@
     include_package_data=True,
     zip_safe=False,
     install_requires=[
-        'setuptools',
         'grokcore.component >= 2.1',
+        'grokcore.site',
         'martian >= 0.13',
-        'grokcore.site',
+        'setuptools',
         'zc.catalog',
+        'zope.annotation',
         'zope.catalog',
+        'zope.component',
+        'zope.container',
+        'zope.event',
+        'zope.exceptions',
         'zope.interface',
+        'zope.intid',
+        'zope.lifecycleevent',
+        'zope.site',
         ],
     tests_require=tests_require,
     extras_require={'test': tests_require},

Modified: grokcore.catalog/trunk/src/grokcore/catalog/__init__.py
===================================================================
--- grokcore.catalog/trunk/src/grokcore/catalog/__init__.py	2012-04-29 07:47:07 UTC (rev 125366)
+++ grokcore.catalog/trunk/src/grokcore/catalog/__init__.py	2012-04-29 09:38:00 UTC (rev 125367)
@@ -1,4 +1,4 @@
 from grokcore.component import *
 from grokcore.catalog.interfaces import IIndexDefinition
 from grokcore.catalog.index import IndexDefinition, Field, Text, Set, Value
-from grokcore.catalog.components import IndexesClass
+from grokcore.catalog.components import IndexesClass, Indexes

Modified: grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/catalog.py
===================================================================
--- grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/catalog.py	2012-04-29 07:47:07 UTC (rev 125366)
+++ grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/catalog.py	2012-04-29 09:38:00 UTC (rev 125367)
@@ -33,27 +33,33 @@
 
 """
 
-import grok
-from zope import schema, interface
+import grokcore.site
+from zope import interface
 from zope.intid import IntIds
 from zope.intid.interfaces import IIntIds
 from zope.catalog.catalog import Catalog
 from zope.catalog.interfaces import ICatalog
 from zope.catalog.field import FieldIndex
+from grokcore.content import Model, Container
 
+
 def setup_catalog(catalog):
     catalog['name'] = FieldIndex('name', IMammoth)
 
+
 class IMammoth(interface.Interface):
+    name = interface.Attribute()
 
-    name = schema.TextLine()
 
-class Mammoth(grok.Model):
-    grok.implements(IMammoth)
+class Mammoth(Model):
+    interface.implements(IMammoth)
 
     def __init__(self, name):
         self.name = name
 
-class Herd(grok.Container, grok.Site):
-    grok.local_utility(IntIds, provides=IIntIds)
-    grok.local_utility(Catalog, provides=ICatalog, setup=setup_catalog)
+
+class Herd(Container, grokcore.site.Site):
+    grokcore.site.local_utility(
+        IntIds, provides=IIntIds)
+    grokcore.site.local_utility(
+        Catalog, provides=ICatalog, setup=setup_catalog)

Modified: grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes.py
===================================================================
--- grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes.py	2012-04-29 07:47:07 UTC (rev 125366)
+++ grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes.py	2012-04-29 09:38:00 UTC (rev 125367)
@@ -64,15 +64,15 @@
 
 import grokcore.catalog
 import grokcore.site
-from grokcore.content import Container, Application
+from grokcore.content import Container, Model
 from zope.interface import Interface, Attribute, implements
 
 
-class Herd(Container, Application):
+class Herd(Container, grokcore.site.Application):
     pass
 
 
-class Herd2(Container, Application):
+class Herd2(Container, grokcore.site.Application):
     pass
 
 
@@ -86,7 +86,7 @@
 
 
 class MammothIndexes(grokcore.catalog.Indexes):
-    grokcore.catalog.site(Herd)
+    grokcore.site.site(Herd)
     grokcore.catalog.context(IMammoth)
 
     name = grokcore.catalog.Field()

Modified: grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_app_interface.py
===================================================================
--- grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_app_interface.py	2012-04-29 07:47:07 UTC (rev 125366)
+++ grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_app_interface.py	2012-04-29 09:38:00 UTC (rev 125367)
@@ -55,21 +55,21 @@
   True
 """
 
+import grokcore.site
 import grokcore.catalog
-from grokcore.content import Container, Application
-from zope.interface import Interface, implements
-from zope import schema
+from grokcore.content import Container
+from zope.interface import Attribute, Interface, implements
 
 
 class IHerd(Interface):
     pass
 
 
-class Herd(Container, Application):
+class Herd(Container, grokcore.site.Application):
     implements(IHerd)
 
 
-class Herd2(Container, Application):
+class Herd2(Container, grokcore.site.Application):
     implements(IHerd)
 
 
@@ -82,10 +82,10 @@
         """
 
 
-class MammothIndexes(grok.Indexes):
-    grok.site(IHerd)
-    grok.context(IMammoth)
+class MammothIndexes(grokcore.catalog.Indexes):
+    grokcore.site.site(IHerd)
+    grokcore.catalog.context(IMammoth)
 
-    name = index.Field()
-    age = index.Field()
-    message = index.Text()
+    name = grokcore.catalog.Field()
+    age = grokcore.catalog.Field()
+    message = grokcore.catalog.Text()

Modified: grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_attribute.py
===================================================================
--- grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_attribute.py	2012-04-29 07:47:07 UTC (rev 125366)
+++ grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_attribute.py	2012-04-29 09:38:00 UTC (rev 125367)
@@ -39,29 +39,32 @@
   True
 """
 
-from zope.interface import Interface
-from zope import schema
+import grokcore.site
+import grokcore.catalog
+from grokcore.content import Container, Model
+from zope.interface import implements, Attribute, Interface
 
-import grok
-from grok import index
 
-class Herd(grok.Container, grok.Application):
+class Herd(Container, grokcore.site.Application):
     pass
 
+
 class IMammoth(Interface):
-    name = schema.TextLine(title=u'Name')
-    age = schema.Int(title=u'Age')
+    age = Attribute('Age')
+    name = Attribute('Name')
 
-class MammothIndexes(grok.Indexes):
-    grok.site(Herd)
-    grok.context(IMammoth)
 
-    name = index.Field()
-    how_old = index.Field(attribute='age')
+class MammothIndexes(grokcore.catalog.Indexes):
+    grokcore.site.site(Herd)
+    grokcore.catalog.context(IMammoth)
 
-class Mammoth(grok.Model):
-    grok.implements(IMammoth)
+    name = grokcore.catalog.Field()
+    how_old = grokcore.catalog.Field('age')
 
+
+class Mammoth(Model):
+    implements(IMammoth)
+
     def __init__(self, name, age):
         self.name = name
         self.age = age

Modified: grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_class.py
===================================================================
--- grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_class.py	2012-04-29 07:47:07 UTC (rev 125366)
+++ grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_class.py	2012-04-29 09:38:00 UTC (rev 125367)
@@ -53,11 +53,12 @@
 Unfortunately ftests don't have good isolation from each other yet.
 """
 
+import grokcore.site
 import grokcore.catalog
-from grokcore.content import Container, Application, Model
+from grokcore.content import Container, Model
 
 
-class Herd(Container, Application):
+class Herd(Container, grokcore.site.Application):
     pass
 
 
@@ -72,9 +73,9 @@
         return self._message
 
 
-class MammothIndexes(Indexes):
+class MammothIndexes(grokcore.catalog.Indexes):
     grokcore.catalog.context(Mammoth)
-    grokcore.catalog.site(Herd)
+    grokcore.site.site(Herd)
     
     name = grokcore.catalog.Field()
     age = grokcore.catalog.Field()

Modified: grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_multiple.py
===================================================================
--- grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_multiple.py	2012-04-29 07:47:07 UTC (rev 125366)
+++ grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_multiple.py	2012-04-29 09:38:00 UTC (rev 125367)
@@ -36,12 +36,11 @@
 
 import grokcore.catalog
 import grokcore.site
-from grokcore.content import Container, Application
-from zope.interface import Interface
-from zope import schema
+from grokcore.content import Container
+from zope.interface import Interface, Attribute
 
 
-class Herd(Container, Application):
+class Herd(Container, grokcore.site.Application):
     pass
 
 
@@ -73,8 +72,8 @@
 
 
 class MammothIndexes2(grokcore.catalog.Indexes):
-    grok.site(Herd)
-    grok.context(IMammoth2)
+    grokcore.site.site(Herd)
+    grokcore.catalog.context(IMammoth2)
 
     name2 = grokcore.catalog.Field()
     age2 = grokcore.catalog.Field()

Modified: grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_multiple_conflict.py
===================================================================
--- grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_multiple_conflict.py	2012-04-29 07:47:07 UTC (rev 125366)
+++ grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_multiple_conflict.py	2012-04-29 09:38:00 UTC (rev 125367)
@@ -34,30 +34,31 @@
 Unfortunately ftests don't have good isolation from each other yet.
 """
 
+import grokcore.site
 import grokcore.catalog
-from grokcore.content import Container, Application, Model
-from zope.interface import Interface
+from grokcore.content import Container
+from zope.interface import Interface, Attribute
 
 
-class Herd(Container, Application):
+class Herd(Container, grokcore.site.Application):
     pass
 
 
 class IMammoth(Interface):
-    name = Attribute('')
+    name = Attribute('name')
 
 
 class IMammoth2(Interface):
-    name = Attribute('')
+    name = Attribute('name')
 
 
 class MammothIndexes(grokcore.catalog.Indexes):
-    grokcore.catalog.site(Herd)
+    grokcore.site.site(Herd)
     grokcore.catalog.context(IMammoth)
     name = grokcore.catalog.Field()
 
 
 class MammothIndexes2(grokcore.catalog.Indexes):
-    grokcore.catalog.site(Herd)
+    grokcore.site.site(Herd)
     grokcore.catalog.context(IMammoth2)
     name = grokcore.catalog.Field()

Modified: grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_name.py
===================================================================
--- grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_name.py	2012-04-29 07:47:07 UTC (rev 125366)
+++ grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_name.py	2012-04-29 09:38:00 UTC (rev 125367)
@@ -36,10 +36,10 @@
 """
 import grokcore.site
 import grokcore.catalog
-from grokcore.content import Container, Application, Model
+from grokcore.content import Container, Model
 
 
-class Herd(Container, Application):
+class Herd(Container, grokcore.site.Application):
     pass
 
 

Modified: grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_nonexistent.py
===================================================================
--- grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_nonexistent.py	2012-04-29 07:47:07 UTC (rev 125366)
+++ grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_nonexistent.py	2012-04-29 09:38:00 UTC (rev 125367)
@@ -37,17 +37,17 @@
 
 import grokcore.site
 import grokcore.catalog
-from zope.interface import Interface
-from grokcore.content import Container, Application
+from zope.interface import Interface, Attribute
+from grokcore.content import Container
 
 
-class Herd(Container, Application):
+class Herd(Container, grokcore.site.Application):
     pass
 
 
 class IMammoth(Interface):
-    name = Attribute('')
-    age = Attribute('')
+    name = Attribute('name')
+    age = Attribute('age')
 
     def message():
         """Message the mammoth has for the world.

Modified: grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_set.py
===================================================================
--- grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_set.py	2012-04-29 07:47:07 UTC (rev 125366)
+++ grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_set.py	2012-04-29 09:38:00 UTC (rev 125367)
@@ -48,11 +48,11 @@
 
 import grokcore.site
 import grokcore.catalog
-from grokcore.content import Container, Application, Model
-from zope.interface import Interface, Attribute
+from grokcore.content import Container, Model
+from zope.interface import implements, Interface, Attribute
 
 
-class Herd(Container, Application):
+class Herd(Container, grokcore.site.Application):
     pass
 
 

Modified: grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_site.py
===================================================================
--- grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_site.py	2012-04-29 07:47:07 UTC (rev 125366)
+++ grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_site.py	2012-04-29 09:38:00 UTC (rev 125367)
@@ -34,11 +34,11 @@
 
 import grokcore.site
 import grokcore.catalog 
-from grokcore.content import Container, Site
-from zope.interface import Interface
+from grokcore.content import Container
+from zope.interface import Interface, Attribute
 
 
-class Herd(Container, Site):
+class Herd(Container, grokcore.site.Site):
     pass
 
 
@@ -52,7 +52,7 @@
 
 
 class MammothIndexes(grokcore.catalog.Indexes):
-    grokcore.catalog.site(Herd)
+    grokcore.site.site(Herd)
     grokcore.catalog.context(IMammoth)
 
     name = grokcore.catalog.Field()

Modified: grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_valueindex.py
===================================================================
--- grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_valueindex.py	2012-04-29 07:47:07 UTC (rev 125366)
+++ grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/indexes_valueindex.py	2012-04-29 09:38:00 UTC (rev 125367)
@@ -51,7 +51,7 @@
 import grokcore.site
 import grokcore.catalog
 from grokcore.content import Container, Model
-from zope.interface import Interface, Attribute
+from zope.interface import implements, Interface, Attribute
 
 
 class Herd(Container, grokcore.site.Application):
@@ -62,7 +62,7 @@
     feature = Attribute('Feature')
 
 
-class SabreToothIndexes(grokcore.site.Indexes):
+class SabreToothIndexes(grokcore.catalog.Indexes):
     grokcore.site.site(Herd)
     grokcore.catalog.context(ISabreTooth)
 

Modified: grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/setuporder.py
===================================================================
--- grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/setuporder.py	2012-04-29 07:47:07 UTC (rev 125366)
+++ grokcore.catalog/trunk/src/grokcore/catalog/ftests/catalog/setuporder.py	2012-04-29 09:38:00 UTC (rev 125367)
@@ -36,26 +36,26 @@
 
 """
 
-from zope import schema, interface
+from zope import interface
 from zope.intid import IntIds
 from zope.intid.interfaces import IIntIds
 from zope.catalog.catalog import Catalog
 from zope.catalog.interfaces import ICatalog
 from zope.catalog.field import FieldIndex
-from grokcore.content import Model, Container, Site
-from grokcore.site import local_utility
+from grokcore.content import Model, Container
+from grokcore.site import local_utility, Site
 
 
 def setup_catalog(catalog):
     catalog['name'] = FieldIndex('name', IMammoth)
 
 
-class IMammoth(Interface):
-    name = Attribute('Name')
+class IMammoth(interface.Interface):
+    name = interface.Attribute('Name')
 
 
 class Mammoth(Model):
-    grok.implements(IMammoth)
+    interface.implements(IMammoth)
 
     def __init__(self, name):
         self.name = name
@@ -66,4 +66,4 @@
 
 
 class Herd(BaseHerd):
-    grok.local_utility(Catalog, provides=ICatalog, setup=setup_catalog)
+    local_utility(Catalog, provides=ICatalog, setup=setup_catalog)

Modified: grokcore.catalog/trunk/src/grokcore/catalog/ftests/test_grok_functional.py
===================================================================
--- grokcore.catalog/trunk/src/grokcore/catalog/ftests/test_grok_functional.py	2012-04-29 07:47:07 UTC (rev 125366)
+++ grokcore.catalog/trunk/src/grokcore/catalog/ftests/test_grok_functional.py	2012-04-29 09:38:00 UTC (rev 125367)
@@ -33,11 +33,13 @@
         suite.addTest(test)
     return suite
 
+
 def test_suite():
     suite = unittest.TestSuite()
     for name in ["catalog"]:
         suite.addTest(suiteFromPackage(name))
     return suite
 
+
 if __name__ == '__main__':
     unittest.main(defaultTest='test_suite')

Modified: grokcore.catalog/trunk/src/grokcore/catalog/tests/catalog/indexes_no_app.py
===================================================================
--- grokcore.catalog/trunk/src/grokcore/catalog/tests/catalog/indexes_no_app.py	2012-04-29 07:47:07 UTC (rev 125366)
+++ grokcore.catalog/trunk/src/grokcore/catalog/tests/catalog/indexes_no_app.py	2012-04-29 09:38:00 UTC (rev 125367)
@@ -3,7 +3,8 @@
 special indexes declaration.  We do need to specify a site (such as
 the application) for the Indexes however, otherwise we get a GrokError:
 
-  >>> grokcore.catalog.testing.grok(__name__)
+  >>> from grokcore.catalog import testing
+  >>> testing.grok(__name__)
   Traceback (most recent call last):
     ...
   GrokError: No site specified for grok.Indexes subclass in module
@@ -11,13 +12,14 @@
   Use grokcore.site.site() to specify.
   
 """
+import grokcore.site
 import grokcore.catalog
 import grokcore.component
 from grokcore.site import Application
 from grokcore.content import Model, Container
 
 
-class Herd(Container, Application):
+class Herd(Container, grokcore.site.Application):
     pass
 
 



More information about the checkins mailing list