Commit a616202f authored by Tres Seaver's avatar Tres Seaver

Add tests that the Z3 IWriteLock interface is present.

parent 316abb73
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')
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')
...@@ -154,6 +154,11 @@ class ZPTUnicodeEncodingConflictResolution(ZopeTestCase): ...@@ -154,6 +154,11 @@ class ZPTUnicodeEncodingConflictResolution(ZopeTestCase):
class ZopePageTemplateFileTests(ZopeTestCase): 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): def testPT_RenderWithAscii(self):
manage_addPageTemplate(self.app, 'test', text=ascii_str, encoding='ascii') manage_addPageTemplate(self.app, 'test', text=ascii_str, encoding='ascii')
zpt = self.app['test'] zpt = self.app['test']
......
...@@ -296,11 +296,19 @@ class TestPythonScriptGlobals(PythonScriptTestBase, WarningInterceptor): ...@@ -296,11 +296,19 @@ class TestPythonScriptGlobals(PythonScriptTestBase, WarningInterceptor):
self.assertEqual(f(), [0]) self.assertEqual(f(), [0])
self._free_warning_output() 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(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestPythonScriptNoAq)) suite.addTest(unittest.makeSuite(TestPythonScriptNoAq))
suite.addTest(unittest.makeSuite(TestPythonScriptErrors)) suite.addTest(unittest.makeSuite(TestPythonScriptErrors))
suite.addTest(unittest.makeSuite(TestPythonScriptGlobals)) suite.addTest(unittest.makeSuite(TestPythonScriptGlobals))
suite.addTest(unittest.makeSuite(PythonScriptInterfaceConformanceTests))
return suite return suite
......
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')
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment