[Zope3-checkins] CVS: Zope3/src/zope/app/rdb/tests - rdb.zcml:1.1
test_directives.py:1.1 test_connectiondirective.py:NONE
Stephan Richter
srichter at cosmos.phy.tufts.edu
Sun Aug 3 13:07:50 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app/rdb/tests
In directory cvs.zope.org:/tmp/cvs-serv28857/tests
Added Files:
rdb.zcml test_directives.py
Removed Files:
test_connectiondirective.py
Log Message:
Converted 'rdb' ZCML namespace.
=== Added File Zope3/src/zope/app/rdb/tests/rdb.zcml ===
<configure xmlns="http://namespaces.zope.org/zope"
xmlns:rdb="http://namespaces.zope.org/rdb">
<include package="zope.app.component" file="meta.zcml"/>
<include package="zope.app.rdb" file="meta.zcml"/>
<include package="zope.app.rdb" file="service.zcml"/>
<rdb:provideConnection
name="stub"
component="zope.app.rdb.tests.test_zopedatabaseadapter.DAStub"
dsn="dbi://dbname" />
</configure>
=== Added File Zope3/src/zope/app/rdb/tests/test_directives.py ===
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Test 'rdb' ZCML Namespace Directives
$Id: test_directives.py,v 1.1 2003/08/03 16:07:44 srichter Exp $
"""
import unittest
from zope.configuration import xmlconfig
from zope.security.management import newSecurityManager, system_user
from zope.app.rdb import queryConnection, getAvailableConnections
from zope.app.rdb import ZopeConnection
import zope.app.rdb.tests
class DirectivesTest(unittest.TestCase):
def test_provideConnection(self):
self.assertEqual(getAvailableConnections(), [])
self.assertEqual(queryConnection('stub', None), None)
self.context = xmlconfig.file("rdb.zcml", zope.app.rdb.tests)
self.assertEqual(getAvailableConnections(), ["stub"])
self.assertEqual(queryConnection('stub').__class__, ZopeConnection)
self.assertEqual(queryConnection('stubbie', None), None)
def test_suite():
return unittest.TestSuite((
unittest.makeSuite(DirectivesTest),
))
if __name__ == '__main__':
unittest.main()
=== Removed File Zope3/src/zope/app/rdb/tests/test_connectiondirective.py ===
More information about the Zope3-Checkins
mailing list