Update of /cvsroot/mailman/mailman3/src/mailman/stubbackend/tests
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13326
Modified Files:
Tag: 3.0
test_config2.py
Log Message:
bumping
--- NEW FILE: test_config2.py ---
# Copyright (C) 2004 Barry A. Warsaw
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
# Place - Suite 330, Boston, MA 02111-1307, USA.
"""Test the basic configuration stuff."""
import os
import sys
import unittest
from protocols.api import adapt
from mailman import dbmgr
from mailman.config import configuration
from mailman.interfaces.storages import IListStorage
class TestConfig2(unittest.TestCase):
def test_config(self):
if dbmgr.dbmgr.lists:
# test.py keeps dbmgr form last time; try to clear it.
sys.modules['mailman.dbmgr'].dbmgr = dbmgr.DatabaseManager()
# Re-calculate the path to the etc directory. BAW: assume, for now,
# that it's a sibling of the directory of the parent of the top-level
# mailman package.
import mailman
mmhere = os.path.abspath(os.path.dirname(mailman.__file__))
mmroot = os.path.normpath(os.path.join(mmhere, os.pardir, os.pardir))
conffile = os.path.normpath(
os.path.join(mmroot, 'etc/backendtest.conf'))
configuration.configure(conffile)
# After the above line, dbmgr should know about our backend.
lists = adapt(dbmgr.dbmgr.lists, IListStorage)
# If adapt doesn't complain, we have a thing that works as IListStorage
self.failUnless(lists)
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestConfig2))
return suite
if __name__ == '__main__':
unittest.main()
_______________________________________________
Mailman-checkins mailing list
[EMAIL PROTECTED]
Unsubscribe: http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org