From: Otto Moerbeek Date: Tue, 25 Oct 2022 14:15:07 +0000 (+0200) Subject: Fix assertAlmostEqual call to compare absolute difference X-Git-Tag: rec-4.8.0-beta2~6^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F12144%2Fhead;p=thirdparty%2Fpdns.git Fix assertAlmostEqual call to compare absolute difference (cherry picked from commit 67dd4251f758a695dab05e206a32199ccee6c214) (cherry picked from commit 23064464fe298ac748470942de6e04a429be9a31) Backport of #12054 and #12133 --- diff --git a/regression-tests.recursor-dnssec/test_LockedCache.py b/regression-tests.recursor-dnssec/test_LockedCache.py index 4977f76a62..64f316165e 100644 --- a/regression-tests.recursor-dnssec/test_LockedCache.py +++ b/regression-tests.recursor-dnssec/test_LockedCache.py @@ -27,7 +27,7 @@ class testLockedCache(RecursorTest): pieces = i.split(' ') print(pieces) if pieces[0] == 'mx1.secure.example.' and pieces[4] == 'A': - return pieces[2] + return int(pieces[2]) raise AssertionError("Cache Line not found"); except subprocess.CalledProcessError as e: @@ -102,4 +102,4 @@ class testNotLockedCache(RecursorTest): self.assertRRsetInAnswer(res, expected2) self.assertMatchingRRSIGInAnswer(res, expected2) ttl2 = self.getCacheTTL() - self.assertAlmostEqual(ttl1, ttl2, 1) + self.assertAlmostEqual(ttl1, ttl2, delta=1)