From 3e5b8fdc6ae18c4b51bd89f6b2eca564f08125c9 Mon Sep 17 00:00:00 2001 From: sebres Date: Thu, 18 Apr 2019 22:44:14 +0200 Subject: [PATCH] fixes coverage of dbmaxmatches = 0 --- fail2ban/tests/databasetestcase.py | 1 + 1 file changed, 1 insertion(+) diff --git a/fail2ban/tests/databasetestcase.py b/fail2ban/tests/databasetestcase.py index 8bb28dfe..af9298a2 100644 --- a/fail2ban/tests/databasetestcase.py +++ b/fail2ban/tests/databasetestcase.py @@ -380,6 +380,7 @@ class DatabaseTest(LogCaptureTestCase): maxmatches=0) self.assertEqual(len(ticket.getMatches()), 0) # dbmaxmatches = 0, should retrieve 0 matches by last ban: + ticket.setMatches(["1","2","3"]) self.db.maxMatches = 0; self.db.addBan(self.jail, ticket) ticket = self.db.getCurrentBans(self.jail, "127.0.0.1", fromtime=MyTime.time()-100)