Add the i18n test in src/test.py

This commit is contained in:
Valentin Lorentz 2010-10-31 11:30:04 +01:00
parent 0360451cb9
commit 283a026449

View File

@ -37,6 +37,7 @@ import unittest
import threading
import supybot.log as log
import supybot.i18n as i18n
import supybot.conf as conf
import supybot.utils as utils
import supybot.ircdb as ircdb
@ -359,6 +360,7 @@ class PluginTestCase(SupyTestCase):
return
for cb in self.irc.callbacks:
name = cb.name()
print " --- " + name
if ((name in self._noTestDoc) and \
not name.lower() in self.__class__.__name__.lower()):
continue
@ -370,6 +372,13 @@ class PluginTestCase(SupyTestCase):
attr == callbacks.canonicalName(attr):
self.failUnless(getattr(cb, attr, None).__doc__,
'%s.%s has no help.' % (name, attr))
def testInternationalization(self):
name = self.__class__.__module__[0:-len('.test')]
if self.__class__.__module__.startswith('supybot'):
return
self.failIf(hasattr(sys.modules[name], '_') == False,
'%s has no internationalizer.' % name)
class ChannelPluginTestCase(PluginTestCase):