[Zope3-checkins] CVS: Zope3/src/zope/app/schemagen/tests - setstatemodule.py.txt:1.1.2.3 setstatemodule_no_history.py.txt:1.1.2.3 test_modulegen.py:1.1.2.3 test_schemaspec.py:1.1.2.3
Tim Peters
tim.one@comcast.net
Tue, 24 Dec 2002 21:21:46 -0500
Update of /cvs-repository/Zope3/src/zope/app/schemagen/tests
In directory cvs.zope.org:/tmp/cvs-serv19240/src/zope/app/schemagen/tests
Modified Files:
Tag: NameGeddon-branch
setstatemodule.py.txt setstatemodule_no_history.py.txt
test_modulegen.py test_schemaspec.py
Log Message:
Whitespace normalization, via Python's Tools/scripts/reindent.py. The
files are fixed-points of that script now. Fixed a few cases where
code relied on significant trailing whitespace (ouch).
=== Zope3/src/zope/app/schemagen/tests/setstatemodule.py.txt 1.1.2.2 => 1.1.2.3 ===
--- Zope3/src/zope/app/schemagen/tests/setstatemodule.py.txt:1.1.2.2 Tue Dec 24 12:52:20 2002
+++ Zope3/src/zope/app/schemagen/tests/setstatemodule.py.txt Tue Dec 24 21:20:45 2002
@@ -9,14 +9,14 @@
class IFoo(Interface):
"""Autogenerated schema."""
alpha = Text(title=u'alpha')
-
+
class FooClass(Persistent):
"""Autogenerated class for IFoo."""
__implements__ = IFoo
def __init__(self):
self.__schema_version__ = 1
-
+
alpha = FieldProperty(IFoo['alpha'])
def __setstate__(self, state):
@@ -26,4 +26,3 @@
dict = self.__dict__
if 0 in transformations:
schemaspec.AddField.update(dict, state, 'alpha')
-
=== Zope3/src/zope/app/schemagen/tests/setstatemodule_no_history.py.txt 1.1.2.2 => 1.1.2.3 ===
--- Zope3/src/zope/app/schemagen/tests/setstatemodule_no_history.py.txt:1.1.2.2 Tue Dec 24 12:52:20 2002
+++ Zope3/src/zope/app/schemagen/tests/setstatemodule_no_history.py.txt Tue Dec 24 21:20:45 2002
@@ -8,7 +8,7 @@
class IFoo(Interface):
"""Autogenerated schema."""
-
+
class FooClass(Persistent):
"""Autogenerated class for IFoo."""
__implements__ = IFoo
=== Zope3/src/zope/app/schemagen/tests/test_modulegen.py 1.1.2.2 => 1.1.2.3 ===
--- Zope3/src/zope/app/schemagen/tests/test_modulegen.py:1.1.2.2 Tue Dec 24 07:51:15 2002
+++ Zope3/src/zope/app/schemagen/tests/test_modulegen.py Tue Dec 24 21:20:45 2002
@@ -20,7 +20,7 @@
from zope.schema import Field, Text, Int, Float, getFieldsInOrder
from zope.app.schemagen.modulegen import generateModuleSource
-
+
class GenerateModuleSourceTestsBase(TestCase):
fields = []
@@ -32,7 +32,7 @@
exec source in g
del g['__builtins__'] # to ease inspection during debugging
self.g = g
-
+
def test_schema(self):
IFoo = self.g['IFoo']
self.assertEquals(self.fields, getFieldsInOrder(IFoo))
@@ -41,10 +41,10 @@
IFoo = self.g['IFoo']
# not dealing with issues of schema inheritance,
# so simply get all fields
- fields = getFieldsInOrder(IFoo)
+ fields = getFieldsInOrder(IFoo)
new_source = generateModuleSource('IFoo', fields, 'Foo')
self.assertEquals(self.source, new_source)
-
+
def test_class(self):
from zope.schema.fieldproperty import FieldProperty
IFoo = self.g['IFoo']
@@ -79,7 +79,7 @@
('bar', Int(title=u"Bar")),
('hoi', Float(title=u"Float")),
('dag', Int(title=u"Dag", default=42)),]
-
+
def test_extraMethods(self):
extra_methods = """\
def forGreatJustice(self):
@@ -103,11 +103,10 @@
exec source in g
del g['__builtins__'] # to ease inspection during debugging
self.assert_(g['test_modulegen'] is test_modulegen)
-
+
def test_suite():
return TestSuite(
(makeSuite(GenerateModuleSourceTestsEmpty),
makeSuite(GenerateModuleSourceTests1),
makeSuite(ExtraImportsAndMethodsTests),
))
-
=== Zope3/src/zope/app/schemagen/tests/test_schemaspec.py 1.1.2.2 => 1.1.2.3 ===
--- Zope3/src/zope/app/schemagen/tests/test_schemaspec.py:1.1.2.2 Tue Dec 24 12:52:20 2002
+++ Zope3/src/zope/app/schemagen/tests/test_schemaspec.py Tue Dec 24 21:20:45 2002
@@ -28,7 +28,7 @@
def setUp(self):
self.s = SchemaSpec('IFoo')
self.alpha = Text(title=u"alpha")
-
+
def test_addField(self):
s = self.s
s.addField('alpha', self.alpha)
@@ -48,7 +48,7 @@
s = self.s
s.addField('alpha', self.alpha)
self.assertRaises(KeyError, s.addField, 'alpha', self.alpha)
-
+
def test_removeFieldNotPresent(self):
self.assertRaises(KeyError, self.s.removeField, 'alpha')
@@ -65,7 +65,7 @@
s.addField('alpha', self.alpha)
s.addField('beta', Text(title=u"Beta"))
self.assertRaises(KeyError, s.renameField, 'alpha', 'beta')
-
+
def test_renameFieldNotPresent(self):
self.assertRaises(KeyError, self.s.renameField, 'alpha', 'beta')
@@ -107,7 +107,7 @@
('gamma', gamma),
('alpha', self.alpha)],
s.getFieldsInOrder())
-
+
def test_insertFieldBeyondEnd(self):
s = self.s
s.addField('alpha', self.alpha)
@@ -194,7 +194,7 @@
def test_generateModuleSource(self):
s = self.s
s.addField('alpha', self.alpha)
-
+
f = openInTests('setstatemodule.py.txt', 'r')
source = f.read()
f.close()
@@ -219,7 +219,7 @@
self.assertEquals({ 1: 1}, d)
self.assertEquals(obj.foo, 'baz')
self.assertEquals(obj.__schema_version__, 2)
-
+
class ModuleUsageTests(TestCase):
def executeModule(self, s):
@@ -228,7 +228,7 @@
exec source in g
del g['__builtins__'] # to ease inspection during debugging
return g
-
+
def test_setstate(self):
s = SchemaSpec('IFoo', 'Foo')
s.addField('alpha', Text(title=u'Alpha'))
@@ -237,7 +237,7 @@
foo = g['Foo']()
self.assertEquals(foo.__schema_version__, 2)
self.assertEquals(foo.beta, u"default")
-
+
foo.beta = u"Frog"
# this is evil, but we do this for testing
foo.__schema_version__ = 1
@@ -245,7 +245,7 @@
foo.__setstate__(foo.__getstate__())
self.assertEquals(foo.beta, u"default")
self.assertEquals(foo.__schema_version__, 2)
-
+
def test_suite():
return TestSuite(
(makeSuite(SchemaSpecTests),