mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-12 05:02:32 +01:00
Add the i18n test in src/test.py
This commit is contained in:
parent
0360451cb9
commit
283a026449
@ -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):
|
||||||
|
Loading…
Reference in New Issue
Block a user