mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Added cleanConfDir and cleanDataDir to PluginTestCase.
This commit is contained in:
parent
c8fd603129
commit
3beb83f963
13
test/test.py
13
test/test.py
@ -112,12 +112,16 @@ class PluginTestCase(unittest.TestCase):
|
|||||||
"""
|
"""
|
||||||
timeout = 10
|
timeout = 10
|
||||||
plugins = ()
|
plugins = ()
|
||||||
|
cleanConfDir = True
|
||||||
|
cleanDataDir = True
|
||||||
def setUp(self, nick='test'):
|
def setUp(self, nick='test'):
|
||||||
self.myVerbose = world.myVerbose
|
self.myVerbose = world.myVerbose
|
||||||
for filename in os.listdir(conf.confDir):
|
if self.cleanConfDir:
|
||||||
os.remove(os.path.join(conf.confDir, filename))
|
for filename in os.listdir(conf.confDir):
|
||||||
for filename in os.listdir(conf.dataDir):
|
os.remove(os.path.join(conf.confDir, filename))
|
||||||
os.remove(os.path.join(conf.dataDir, filename))
|
if self.cleanDataDir:
|
||||||
|
for filename in os.listdir(conf.dataDir):
|
||||||
|
os.remove(os.path.join(conf.dataDir, filename))
|
||||||
debug.reset()
|
debug.reset()
|
||||||
ircdb.users.reload()
|
ircdb.users.reload()
|
||||||
ircdb.channels.reload()
|
ircdb.channels.reload()
|
||||||
@ -308,6 +312,7 @@ class PluginDocumentation:
|
|||||||
if cb.isCommand(attr):
|
if cb.isCommand(attr):
|
||||||
self.failUnless(getattr(cb, attr).__doc__,
|
self.failUnless(getattr(cb, attr).__doc__,
|
||||||
'%s has no syntax' % attr)
|
'%s has no syntax' % attr)
|
||||||
|
|
||||||
def testAllCommandsHaveMorehelp(self):
|
def testAllCommandsHaveMorehelp(self):
|
||||||
for cb in self.irc.callbacks:
|
for cb in self.irc.callbacks:
|
||||||
if isinstance(cb, callbacks.PrivmsgRegexp):
|
if isinstance(cb, callbacks.PrivmsgRegexp):
|
||||||
|
Loading…
Reference in New Issue
Block a user