extended test-cases (coverage)

pull/1557/head
sebres 2016-09-26 10:50:02 +02:00
parent 449c46aec4
commit 5e4fdb60c8
2 changed files with 6 additions and 1 deletions

View File

@ -211,7 +211,7 @@ class Fail2BanDb(object):
if newversion == Fail2BanDb.__version__:
logSys.warning( "Database updated from '%i' to '%i'",
version, newversion)
else:
else: # pragma: no cover
logSys.error( "Database update failed to achieve version '%i'"
": updated from '%i' to '%i'",
Fail2BanDb.__version__, version, newversion)

View File

@ -353,6 +353,11 @@ class DatabaseTest(LogCaptureTestCase):
# be returned
tickets = self.db.getBansMerged(bantime=-1)
self.assertEqual(len(tickets), 2)
# getCurrentBans:
tickets = self.db.getCurrentBans(jail=self.jail)
self.assertEqual(len(tickets), 2)
ticket = self.db.getCurrentBans(jail=None, ip="127.0.0.1");
self.assertEqual(ticket.getIP(), "127.0.0.1")
def testActionWithDB(self):
# test action together with database functionality