[Zope-Checkins] SVN: Zope/branches/tseaver-2.11-no-z2-interfaces/lib/python/ Add tests that the Z3 IWriteLock interface is present.

Tres Seaver tseaver at palladion.com
Sun Apr 27 22:47:38 EDT 2008


Log message for revision 85795:
  Add tests that the Z3 IWriteLock interface is present.

Changed:
  A   Zope/branches/tseaver-2.11-no-z2-interfaces/lib/python/OFS/tests/test_DTMLDocument.py
  A   Zope/branches/tseaver-2.11-no-z2-interfaces/lib/python/OFS/tests/test_DTMLMethod.py
  U   Zope/branches/tseaver-2.11-no-z2-interfaces/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py
  U   Zope/branches/tseaver-2.11-no-z2-interfaces/lib/python/Products/PythonScripts/tests/testPythonScript.py
  A   Zope/branches/tseaver-2.11-no-z2-interfaces/lib/python/Products/ZSQLMethods/tests/
  A   Zope/branches/tseaver-2.11-no-z2-interfaces/lib/python/Products/ZSQLMethods/tests/__init__.py
  A   Zope/branches/tseaver-2.11-no-z2-interfaces/lib/python/Products/ZSQLMethods/tests/test_SQL.py

-=-
Added: Zope/branches/tseaver-2.11-no-z2-interfaces/lib/python/OFS/tests/test_DTMLDocument.py
===================================================================
--- Zope/branches/tseaver-2.11-no-z2-interfaces/lib/python/OFS/tests/test_DTMLDocument.py	                        (rev 0)
+++ Zope/branches/tseaver-2.11-no-z2-interfaces/lib/python/OFS/tests/test_DTMLDocument.py	2008-04-28 02:47:37 UTC (rev 85795)
@@ -0,0 +1,24 @@
+import unittest
+
+class DTMLDocumentTests(unittest.TestCase):
+
+    def _getTargetClass(self):
+        from OFS.DTMLDocument import DTMLDocument
+        return DTMLDocument
+
+    def _makeOne(self, *args, **kw):
+        return self._getTargetClass()(*args, **kw)
+
+    def test_class_conforms_to_IWriteLock(self):
+        from zope.interface.verify import verifyClass
+        from webdav.interfaces import IWriteLock
+        verifyClass(IWriteLock, self._getTargetClass())
+
+
+def test_suite():
+    return unittest.TestSuite((
+        unittest.makeSuite(DTMLDocumentTests),
+        ))
+
+if __name__ == '__main__':
+    unittest.main(defaultTest='test_suite')

Added: Zope/branches/tseaver-2.11-no-z2-interfaces/lib/python/OFS/tests/test_DTMLMethod.py
===================================================================
--- Zope/branches/tseaver-2.11-no-z2-interfaces/lib/python/OFS/tests/test_DTMLMethod.py	                        (rev 0)
+++ Zope/branches/tseaver-2.11-no-z2-interfaces/lib/python/OFS/tests/test_DTMLMethod.py	2008-04-28 02:47:37 UTC (rev 85795)
@@ -0,0 +1,24 @@
+import unittest
+
+class DTMLMethodTests(unittest.TestCase):
+
+    def _getTargetClass(self):
+        from OFS.DTMLMethod import DTMLMethod
+        return DTMLMethod
+
+    def _makeOne(self, *args, **kw):
+        return self._getTargetClass()(*args, **kw)
+
+    def test_class_conforms_to_IWriteLock(self):
+        from zope.interface.verify import verifyClass
+        from webdav.interfaces import IWriteLock
+        verifyClass(IWriteLock, self._getTargetClass())
+
+
+def test_suite():
+    return unittest.TestSuite((
+        unittest.makeSuite(DTMLMethodTests),
+        ))
+
+if __name__ == '__main__':
+    unittest.main(defaultTest='test_suite')

Modified: Zope/branches/tseaver-2.11-no-z2-interfaces/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py
===================================================================
--- Zope/branches/tseaver-2.11-no-z2-interfaces/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py	2008-04-28 02:00:40 UTC (rev 85794)
+++ Zope/branches/tseaver-2.11-no-z2-interfaces/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py	2008-04-28 02:47:37 UTC (rev 85795)
@@ -154,6 +154,11 @@
 
 class ZopePageTemplateFileTests(ZopeTestCase):
 
+    def test_class_conforms_to_IWriteLock(self):
+        from zope.interface.verify import verifyClass
+        from webdav.interfaces import IWriteLock
+        verifyClass(IWriteLock, ZopePageTemplate)
+
     def testPT_RenderWithAscii(self):
         manage_addPageTemplate(self.app, 'test', text=ascii_str, encoding='ascii')
         zpt = self.app['test']

Modified: Zope/branches/tseaver-2.11-no-z2-interfaces/lib/python/Products/PythonScripts/tests/testPythonScript.py
===================================================================
--- Zope/branches/tseaver-2.11-no-z2-interfaces/lib/python/Products/PythonScripts/tests/testPythonScript.py	2008-04-28 02:00:40 UTC (rev 85794)
+++ Zope/branches/tseaver-2.11-no-z2-interfaces/lib/python/Products/PythonScripts/tests/testPythonScript.py	2008-04-28 02:47:37 UTC (rev 85795)
@@ -296,11 +296,19 @@
         self.assertEqual(f(), [0])
         self._free_warning_output()
 
+class PythonScriptInterfaceConformanceTests(unittest.TestCase):
+
+    def test_class_conforms_to_IWriteLock(self):
+        from zope.interface.verify import verifyClass
+        from webdav.interfaces import IWriteLock
+        verifyClass(IWriteLock, PythonScript)
+
 def test_suite():
     suite = unittest.TestSuite()
     suite.addTest(unittest.makeSuite(TestPythonScriptNoAq))
     suite.addTest(unittest.makeSuite(TestPythonScriptErrors))
     suite.addTest(unittest.makeSuite(TestPythonScriptGlobals))
+    suite.addTest(unittest.makeSuite(PythonScriptInterfaceConformanceTests))
     return suite
 
 

Added: Zope/branches/tseaver-2.11-no-z2-interfaces/lib/python/Products/ZSQLMethods/tests/__init__.py
===================================================================
--- Zope/branches/tseaver-2.11-no-z2-interfaces/lib/python/Products/ZSQLMethods/tests/__init__.py	                        (rev 0)
+++ Zope/branches/tseaver-2.11-no-z2-interfaces/lib/python/Products/ZSQLMethods/tests/__init__.py	2008-04-28 02:47:37 UTC (rev 85795)
@@ -0,0 +1 @@
+# Unit tests for ZSQLMethods

Added: Zope/branches/tseaver-2.11-no-z2-interfaces/lib/python/Products/ZSQLMethods/tests/test_SQL.py
===================================================================
--- Zope/branches/tseaver-2.11-no-z2-interfaces/lib/python/Products/ZSQLMethods/tests/test_SQL.py	                        (rev 0)
+++ Zope/branches/tseaver-2.11-no-z2-interfaces/lib/python/Products/ZSQLMethods/tests/test_SQL.py	2008-04-28 02:47:37 UTC (rev 85795)
@@ -0,0 +1,24 @@
+import unittest
+
+class SQLMethodTests(unittest.TestCase):
+
+    def _getTargetClass(self):
+        from Products.ZSQLMethods.SQL import SQL
+        return SQL
+
+    def _makeOne(self, *args, **kw):
+        return self._getTargetClass()(*args, **kw)
+
+    def test_class_conforms_to_IWriteLock(self):
+        from zope.interface.verify import verifyClass
+        from webdav.interfaces import IWriteLock
+        verifyClass(IWriteLock, self._getTargetClass())
+
+
+def test_suite():
+    return unittest.TestSuite((
+        unittest.makeSuite(SQLMethodTests),
+        ))
+
+if __name__ == '__main__':
+    unittest.main(defaultTest='test_suite')



More information about the Zope-Checkins mailing list