[Zodb-checkins] CVS: Zope3/src/zope/interface/tests -
test_declarations.py:1.3
Jim Fulton
jim at zope.com
Tue May 13 16:48:24 EDT 2003
Update of /cvs-repository/Zope3/src/zope/interface/tests
In directory cvs.zope.org:/tmp/cvs-serv2076/src/zope/interface/tests
Modified Files:
test_declarations.py
Log Message:
Improved interface performance using Steve and Guido's metaclass
trick. This sped up Zope substantially (roughly 80% to render / with
a new database).
=== Zope3/src/zope/interface/tests/test_declarations.py 1.2 => 1.3 ===
--- Zope3/src/zope/interface/tests/test_declarations.py:1.2 Sat May 3 12:38:00 2003
+++ Zope3/src/zope/interface/tests/test_declarations.py Tue May 13 15:48:23 2003
@@ -53,16 +53,19 @@
def test_doctest(self):
doctest(self, declarations)
+
+
def test_ObjectSpecification_Simple(self):
c = C()
directlyProvides(c, I4)
spec = providedBy(c)
sig = spec.__signature__
- expect = (c.__provides__.__signature__,
- C.__dict__['__implements__'].__signature__,
- A.__dict__['__implements__'].__signature__,
- B.__dict__['__implements__'].__signature__,
- )
+ expect = ('zope.interface.tests.test_declarations.I4\t'
+ 'zope.interface.Interface',
+ 'zope.interface.tests.test_declarations.I3\t'
+ 'zope.interface.tests.test_declarations.I1\t'
+ 'zope.interface.tests.test_declarations.I2\t'
+ 'zope.interface.Interface')
self.assertEqual(sig, expect)
def test_ObjectSpecification_Simple_w_only(self):
@@ -70,11 +73,10 @@
directlyProvides(c, I4)
spec = providedBy(c)
sig = spec.__signature__
- expect = (c.__provides__.__signature__,
- COnly.__dict__['__implements__'].__signature__,
- A.__dict__['__implements__'].__signature__,
- B.__dict__['__implements__'].__signature__,
- )
+ expect = ('zope.interface.tests.test_declarations.I4\t'
+ 'zope.interface.Interface',
+ 'zope.interface.tests.test_declarations.I3\t'
+ 'zope.interface.Interface')
self.assertEqual(sig, expect)
def test_ObjectSpecification_Simple_old_style(self):
@@ -82,11 +84,10 @@
directlyProvides(c, I4)
spec = providedBy(c)
sig = spec.__signature__
- expect = (c.__provides__.__signature__,
- COnly_old.__dict__['__implements__'].__signature__,
- A.__dict__['__implements__'].__signature__,
- B.__dict__['__implements__'].__signature__,
- )
+ expect = ('zope.interface.tests.test_declarations.I4\t'
+ 'zope.interface.Interface',
+ 'zope.interface.tests.test_declarations.I3\t'
+ 'zope.interface.Interface')
self.assertEqual(sig, expect)
def test_backward_compat(self):
More information about the Zodb-checkins
mailing list