cache coverage

pull/2067/head
sebres 2018-03-02 20:08:48 +01:00
parent 96836cb199
commit 1bdda6c8eb
2 changed files with 3 additions and 1 deletions

View File

@ -102,7 +102,7 @@ class Utils():
def unset(self, k):
try:
del self._cache[k]
except KeyError: # pragme: no cover
except KeyError:
pass

View File

@ -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)