From 6117d3f89bd28fb584e948a8cda1d146af7b4778 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Tue, 25 Oct 2022 16:15:07 +0200 Subject: [PATCH] Fix assertAlmostEqual call to compare absolute difference (cherry picked from commit 67dd4251f758a695dab05e206a32199ccee6c214) (cherry picked from commit 23064464fe298ac748470942de6e04a429be9a31) Backport of #12054 and #12133 --- regression-tests.recursor-dnssec/test_LockedCache.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) -- 2.47.2