]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Use assertNotIn 16481/head
authorJosh Soref <2119212+jsoref@users.noreply.github.com>
Wed, 12 Nov 2025 19:16:06 +0000 (14:16 -0500)
committerJosh Soref <2119212+jsoref@users.noreply.github.com>
Wed, 12 Nov 2025 21:45:51 +0000 (16:45 -0500)
https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertNotIn
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
regression-tests.dnsdist/test_API.py
regression-tests.dnsdist/test_DOH.py
regression-tests.recursor-dnssec/test_SNMP.py

index 3da966fd14da3d9784e1308f7f72646bf87e3fed..939c0181464d96bf1df63ce25c67fa884d42032a 100644 (file)
@@ -529,7 +529,7 @@ class TestAPICustomHeaders(APITestsBase):
         self.assertTrue(r)
         self.assertEqual(r.status_code, 200)
         self.assertEqual(r.headers.get('x-custom'), "custom")
-        self.assertFalse("x-frame-options" in r.headers)
+        self.assertNotIn("x-frame-options", r.headers)
 
     def testBasicHeadersUpdate(self):
         """
index 87275902490d5babc8fadb04d020257254121ff8..c1017c526d3403cf2ecaf5a59fc06e998189b8c9 100644 (file)
@@ -91,7 +91,7 @@ class DOHTests(object):
         self.assertEqual(expectedQuery, receivedQuery)
         self.assertIn(self._customResponseHeader1, self._response_headers.decode())
         self.assertIn(self._customResponseHeader2, self._response_headers.decode())
-        self.assertFalse(('UPPERCASE: VaLuE' in self._response_headers.decode()))
+        self.assertNotIn('UPPERCASE: VaLuE', self._response_headers.decode())
         self.assertIn('uppercase: VaLuE', self._response_headers.decode())
         self.assertIn('cache-control: max-age=3600', self._response_headers.decode())
         self.checkQueryEDNSWithoutECS(expectedQuery, receivedQuery)
index c25ecb73014989a5243218f3ff0ea8b0f14b158f..2826386475a952a42f6e22b94e2b3c465e9806c4 100644 (file)
@@ -28,7 +28,7 @@ class SNMPTest(RecursorTest):
             self.assertTrue(isinstance(results[oid], Counter64))
 
         oid = self._snmpOID + '.1.' + str(count + 1) + '.0'
-        self.assertFalse(oid in results)
+        self.assertNotIn(oid, results)
 
         # check uptime > 0
         self.assertGreater(results['1.3.6.1.4.1.43315.2.1.75.0'], 0)