Update of /cvsroot/mailman/mailman3/src/mailman/categories/tests
In directory 
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31133/src/mailman/categories/tests

Added Files:
      Tag: 3.0
        __init__.py test_category.py test_xmlstring.py 
Log Message:
Initial checkin of Mailman3 source

--- NEW FILE: __init__.py ---

--- NEW FILE: test_category.py ---
# Copyright (C) 2003 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.

import os
import unittest

from mailman.categories import specdir
from mailman.categories.category import Category



class TestCategory(unittest.TestCase):
    def test_general(self):
        eq = self.assertEqual
        cat = Category(os.path.join(specdir, 'general.xml'))
        eq(cat.name, u'general')
        eq(cat.heading, u'General Options')
        eq(cat.description, u'Fundamental list characteristics')
        # BAW We can do better than this
        eq(len(cat.attributes), 12)



def test_suite():
    suite = unittest.TestSuite()
    suite.addTest(unittest.makeSuite(TestCategory))
    return suite

--- NEW FILE: test_xmlstring.py ---
# Copyright (C) 2003 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.

import unittest

from mailman.categories.xmlstring import xmlstring



class Test_xmlstring(unittest.TestCase):
    def test_xmlstring(self):
        eq = self.assertEqual
        eq(xmlstring('hello world'), u'hello world')
        eq(xmlstring(' hello world '), u'hello world')
        eq(xmlstring(' hello     world    \n\t   foo'), u'hello world foo')



def test_suite():
    suite = unittest.TestSuite()
    suite.addTest(unittest.makeSuite(Test_xmlstring))
    return suite


_______________________________________________
Mailman-checkins mailing list
[EMAIL PROTECTED]
Unsubscribe: http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to