TST: cover few more lines in fail2banreader.py

pull/225/head
Yaroslav Halchenko 2013-05-09 23:16:03 -04:00
parent 26715d5e5e
commit e70d01bc10
1 changed files with 9 additions and 0 deletions

View File

@ -160,6 +160,15 @@ class JailsReaderTest(unittest.TestCase):
self.assertEqual(opts['socket'], '/var/run/fail2ban/fail2ban.sock')
self.assertEqual(opts['pidfile'], '/var/run/fail2ban/fail2ban.pid')
configurator.getOptions()
configurator.convertToProtocol()
commands = configurator.getConfigStream()
# and there is logging information left to be passed into the
# server
self.assertEqual(commands,
[['set', 'loglevel', 3],
['set', 'logtarget', '/var/log/fail2ban.log']])
# and if we force change configurator's fail2ban's baseDir
# there should be an error message (test visually ;) --
# otherwise just a code smoke test)