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 threading
import supybot.log as log import supybot.log as log
import supybot.i18n as i18n
import supybot.conf as conf import supybot.conf as conf
import supybot.utils as utils import supybot.utils as utils
import supybot.ircdb as ircdb import supybot.ircdb as ircdb
@ -359,6 +360,7 @@ class PluginTestCase(SupyTestCase):
return return
for cb in self.irc.callbacks: for cb in self.irc.callbacks:
name = cb.name() name = cb.name()
print " --- " + name
if ((name in self._noTestDoc) and \ if ((name in self._noTestDoc) and \
not name.lower() in self.__class__.__name__.lower()): not name.lower() in self.__class__.__name__.lower()):
continue continue
@ -370,6 +372,13 @@ class PluginTestCase(SupyTestCase):
attr == callbacks.canonicalName(attr): attr == callbacks.canonicalName(attr):
self.failUnless(getattr(cb, attr, None).__doc__, self.failUnless(getattr(cb, attr, None).__doc__,
'%s.%s has no help.' % (name, attr)) '%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): class ChannelPluginTestCase(PluginTestCase):