[Zope3-checkins] CVS: Zope3/src/zope/i18n/tests - test_messageid.py:1.1
Paul Winkler
pw_lists@slinkp.com
Mon, 24 Mar 2003 19:23:06 -0500
Update of /cvs-repository/Zope3/src/zope/i18n/tests
In directory cvs.zope.org:/tmp/cvs-serv16798/tests
Added Files:
test_messageid.py
Log Message:
Initial checkin of MessageID class and factory.
=== Added File Zope3/src/zope/i18n/tests/test_messageid.py ===
##############################################################################
#
# Copyright (c) 2003 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.
#
##############################################################################
"""Message ID tests.
$Id: test_messageid.py,v 1.1 2003/03/25 00:23:05 slinkp Exp $
"""
import unittest
from zope.i18n.messageid import MessageIDFactory, MessageID
class TestMessageID(unittest.TestCase):
def test(self):
fact = MessageIDFactory('test')
id = fact(u'this is a test')
self.assert_(isinstance(id, MessageID))
self.assertEqual(id.domain, 'test')
self.assertEqual(id.default, None)
id.setDefault(u'blah')
self.assertEqual(id.default, u'blah')
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestMessageID))
return suite
if __name__ == '__main__':
unittest.main()