Now that we have directories in test-data, we better handle that.

This commit is contained in:
Jeremy Fincher 2004-08-01 12:33:35 +00:00
parent d573550e77
commit 7c41187204

View File

@ -128,13 +128,19 @@ class PluginTestCase(SupyTestCase):
conf.supybot.reply.whenNotCommand.setValue(False) conf.supybot.reply.whenNotCommand.setValue(False)
self.myVerbose = world.myVerbose self.myVerbose = world.myVerbose
if self.cleanConfDir: if self.cleanConfDir:
for filename in os.listdir(conf.supybot.directories.conf()): confDir = conf.supybot.directories.conf()
os.remove(os.path.join(conf.supybot.directories.conf(), for (dirpath, dirnames, filenames) in os.walk(confDir):
filename)) for filename in filenames:
filename = os.path.join(dirpath, filename)
if os.path.isfile(filename):
os.remove(filename)
if self.cleanDataDir: if self.cleanDataDir:
for filename in os.listdir(conf.supybot.directories.data()): dataDir = conf.supybot.directories.data()
os.remove(os.path.join(conf.supybot.directories.data(), for (dirpath, dirnames, filenames) in os.walk(dataDir):
filename)) for filename in filenames:
filename = os.path.join(dirpath, filename)
if os.path.isfile(filename):
os.remove(filename)
ircdb.users.reload() ircdb.users.reload()
ircdb.ignores.reload() ircdb.ignores.reload()
ircdb.channels.reload() ircdb.channels.reload()