mirror of https://github.com/fail2ban/fail2ban
cache coverage
parent
96836cb199
commit
1bdda6c8eb
|
@ -102,7 +102,7 @@ class Utils():
|
|||
def unset(self, k):
|
||||
try:
|
||||
del self._cache[k]
|
||||
except KeyError: # pragme: no cover
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
|
||||
|
|
|
@ -1640,6 +1640,8 @@ class DNSUtilsTests(unittest.TestCase):
|
|||
c.set(i, i)
|
||||
for i in xrange(5):
|
||||
self.assertEqual(c.get(i), i)
|
||||
# remove unavailable key:
|
||||
c.unset('a'); c.unset('a')
|
||||
|
||||
def testCacheMaxSize(self):
|
||||
c = Utils.Cache(maxCount=5, maxTime=60)
|
||||
|
|
Loading…
Reference in New Issue