[CMF-checkins] CVS: Products/CMFCore/tests -
test_FSZSQLMethod.py:1.1.2.1
Jens Vagelpohl
jens at dataflake.org
Wed Apr 6 07:19:46 EDT 2005
Update of /cvs-repository/Products/CMFCore/tests
In directory cvs.zope.org:/tmp/cvs-serv13172/CMFCore/tests
Added Files:
Tag: CMF-1_5-branch
test_FSZSQLMethod.py
Log Message:
- CMFCore.FSZSQLMethod: Added configuration parameters that were left out.
Some of the configuration parameters to ZSQL methods, specifically
those describing custom pluggable brains classes and the
connection_hook, were not implemented in FSZSQLMethod. Also added a
first small unittest module for FSZSQLMethod testing.
(http://www.zope.org/Collectors/CMF/335)
=== Added File Products/CMFCore/tests/test_FSZSQLMethod.py ===
from unittest import TestSuite, makeSuite, main
import Testing
import Zope
Zope.startup()
from Products.CMFCore.FSZSQLMethod import FSZSQLMethod
from Products.CMFCore.tests.base.testcase import FSDVTest
class FSZSQLMethodTests( FSDVTest ):
def setUp(self):
FSDVTest.setUp(self)
self._registerDirectory(self)
def test_initialization(self):
zsql = self.ob.fake_skin.testsql
self.assertEqual(zsql.title, 'This is a title')
self.assertEqual(zsql.connection_id, 'testconn')
self.assertEqual(zsql.arguments_src, 'id')
self.assertEqual(zsql.max_rows_, 1000)
self.assertEqual(zsql.max_cache_, 100)
self.assertEqual(zsql.cache_time_, 10)
self.assertEqual(zsql.class_name_, 'MyRecord')
self.assertEqual(zsql.class_file_, 'CMFCore.TestRecord')
self.assertEqual(zsql.connection_hook, 'MyHook')
def test_suite():
return TestSuite((
makeSuite(FSZSQLMethodTests),
))
if __name__ == '__main__':
main(defaultTest='test_suite')
More information about the CMF-checkins
mailing list