[Zope3-checkins] CVS: Zope3/src/zope/app/schemagen/tests - setstatemodule.py.txt:1.2.26.1 setstatemodule_no_history.py.txt:1.2.26.1 test_modulegen.py:1.3.10.1 test_typereg.py:1.2.26.1

Grégoire Weber zope@i-con.ch
Sun, 22 Jun 2003 10:24:27 -0400


Update of /cvs-repository/Zope3/src/zope/app/schemagen/tests
In directory cvs.zope.org:/tmp/cvs-serv24874/src/zope/app/schemagen/tests

Modified Files:
      Tag: cw-mail-branch
	setstatemodule.py.txt setstatemodule_no_history.py.txt 
	test_modulegen.py test_typereg.py 
Log Message:
Synced up with HEAD

=== Zope3/src/zope/app/schemagen/tests/setstatemodule.py.txt 1.2 => 1.2.26.1 ===
--- Zope3/src/zope/app/schemagen/tests/setstatemodule.py.txt:1.2	Wed Dec 25 09:13:15 2002
+++ Zope3/src/zope/app/schemagen/tests/setstatemodule.py.txt	Sun Jun 22 10:23:23 2003
@@ -1,4 +1,4 @@
-from zope.interface import Interface
+from zope.interface import Interface, implements
 from persistence import Persistent
 from zope.schema.fieldproperty import FieldProperty
 
@@ -12,7 +12,7 @@
 
 class FooClass(Persistent):
     """Autogenerated class for IFoo."""
-    __implements__ = IFoo
+    implements(IFoo)
 
     def __init__(self):
         self.__schema_version__ = 1


=== Zope3/src/zope/app/schemagen/tests/setstatemodule_no_history.py.txt 1.2 => 1.2.26.1 ===
--- Zope3/src/zope/app/schemagen/tests/setstatemodule_no_history.py.txt:1.2	Wed Dec 25 09:13:15 2002
+++ Zope3/src/zope/app/schemagen/tests/setstatemodule_no_history.py.txt	Sun Jun 22 10:23:23 2003
@@ -1,4 +1,4 @@
-from zope.interface import Interface
+from zope.interface import Interface, implements
 from persistence import Persistent
 from zope.schema.fieldproperty import FieldProperty
 
@@ -11,7 +11,7 @@
 
 class FooClass(Persistent):
     """Autogenerated class for IFoo."""
-    __implements__ = IFoo
+    implements(IFoo)
 
     def __init__(self):
         self.__schema_version__ = 0


=== Zope3/src/zope/app/schemagen/tests/test_modulegen.py 1.3 => 1.3.10.1 ===
--- Zope3/src/zope/app/schemagen/tests/test_modulegen.py:1.3	Thu May  1 15:35:31 2003
+++ Zope3/src/zope/app/schemagen/tests/test_modulegen.py	Sun Jun 22 10:23:23 2003
@@ -17,7 +17,8 @@
 
 from unittest import TestCase, makeSuite, TestSuite
 from zope.schema import Text, Int, Float, getFieldsInOrder
-
+from zope.interface import implementedBy
+from persistence.interfaces import IPersistent
 from zope.app.schemagen.modulegen import generateModuleSource
 
 class GenerateModuleSourceTestsBase(TestCase):
@@ -51,7 +52,8 @@
         # we don't want a schema version attribute on the class, just
         # on the individual instances
         self.assertRaises(AttributeError, getattr, Foo, '__schema_version__')
-        self.assertEquals(Foo.__implements__, IFoo)
+        self.assertEquals([i for i in implementedBy(Foo)],
+                          [IFoo, IPersistent])
         for field_name, field in self.fields:
             prop = getattr(Foo, field_name, None)
             self.assert_(prop is not None)


=== Zope3/src/zope/app/schemagen/tests/test_typereg.py 1.2 => 1.2.26.1 ===
--- Zope3/src/zope/app/schemagen/tests/test_typereg.py:1.2	Wed Dec 25 09:13:15 2002
+++ Zope3/src/zope/app/schemagen/tests/test_typereg.py	Sun Jun 22 10:23:23 2003
@@ -23,6 +23,7 @@
      DefaultFieldRepresentation
 
 from zope import schema
+from zope.interface import implements
 
 from zope.schema.interfaces import IField
 
@@ -103,7 +104,7 @@
     def test_register(self):
         from zope.app.interfaces.schemagen import ITypeRepresentation
         class IntRepresentation:
-            __implements__ = ITypeRepresentation
+            implements(ITypeRepresentation)
             def __init__(self, obj):
                 pass
             def getTypes():
@@ -129,7 +130,7 @@
     delta = schema.Int(title=u"Delta", default=0)
 
 class MyField(schema.Field):
-    __implements__ = IFieldSchema
+    implements(IFieldSchema)
 
     def __init__(self, alpha=u'', beta=0, gamma=u'', delta=0, **kw):
         super(MyField, self).__init__(**kw)