]> git.ipfire.org Git - thirdparty/pdns.git/blobdiff - regression-tests.recursor-dnssec/test_API.py
Merge pull request #13453 from omoerbeek/rec-yaml-transition-docs
[thirdparty/pdns.git] / regression-tests.recursor-dnssec / test_API.py
index ec275dd76b6cac756a2b6f08402b528ccf734944..07fc05aa154aa6827d47654f4312b0d2fcaf670d 100644 (file)
@@ -39,11 +39,12 @@ api-key=%s
 """ % (_wsPort, _wsPassword, _apiKey)
 
     def testAPI(self):
+        self.waitForTCPSocket("127.0.0.1", self._wsPort)
         headers = {'x-api-key': self._apiKey}
         url = 'http://127.0.0.1:' + str(self._wsPort) + '/api/v1/servers/localhost/statistics'
         r = requests.get(url, headers=headers, timeout=self._wsTimeout)
         self.assertTrue(r)
-        self.assertEquals(r.status_code, 200)
+        self.assertEqual(r.status_code, 200)
         self.assertTrue(r.json())
 
 class APIDeniedRecursorTest(APIRecursorTest):
@@ -63,6 +64,7 @@ api-key=%s
 """ % (_wsPort, _wsPassword, _apiKey)
 
     def testAPI(self):
+        self.waitForTCPSocket("127.0.0.1", self._wsPort)
         headers = {'x-api-key': self._apiKey}
         url = 'http://127.0.0.1:' + str(self._wsPort) + '/api/v1/servers/localhost/statistics'
         try: