[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/zapi/tests.py Fixed test that verifies that zapi provides IZAPI. It seems that

Amos Latteier amos at latteier.com
Thu Feb 24 22:38:08 EST 2005


Log message for revision 29294:
  Fixed test that verifies that zapi provides IZAPI. It seems that
  deprecation proxies can cause verifyObject to fail under certain
  conditions (such as running the full test suite ;-)
  

Changed:
  U   Zope3/trunk/src/zope/app/zapi/tests.py

-=-
Modified: Zope3/trunk/src/zope/app/zapi/tests.py
===================================================================
--- Zope3/trunk/src/zope/app/zapi/tests.py	2005-02-24 22:48:58 UTC (rev 29293)
+++ Zope3/trunk/src/zope/app/zapi/tests.py	2005-02-25 03:38:07 UTC (rev 29294)
@@ -18,12 +18,22 @@
 import unittest
 from zope.app.testing import placelesssetup
 from zope.app import zapi
+from zope.app.zapi.interfaces import IZAPI
 from zope.interface.verify import verifyObject
+from zope.proxy import removeAllProxies, isProxy
 
 class TestIZAPI(unittest.TestCase):
 
     def test_izapi(self):
-        self.assert_(verifyObject(zapi.interfaces.IZAPI, zapi))
+        """
+        Ensure that the zapi module provides the IZAPI interface
+        """
+        from zope.app import zapi
+        # deprecation proxies don't seem to always work with
+        # verifyObject, so remove any proxies
+        if isProxy(zapi):
+            zapi = removeAllProxies(zapi)
+        verifyObject(IZAPI, zapi)
         
 
 def setUp(test):



More information about the Zope3-Checkins mailing list