From e9de714fdaa3516983fdc07738f052737c2e28d0 Mon Sep 17 00:00:00 2001 From: Maja Massarini Date: Mon, 23 Sep 2024 13:16:34 +0200 Subject: [PATCH] Use packit.dev to validate RequestResponseHandling Since example.com does not allow posts requests anymore. A 403 error is returned. --- tests/test_request_response.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/test_request_response.py b/tests/test_request_response.py index 01d4e09..c21d253 100644 --- a/tests/test_request_response.py +++ b/tests/test_request_response.py @@ -30,15 +30,21 @@ def testRawCall(self): """ Test if is class is able to explicitly write and read request handling """ - keys = [self.domain] + # example.com domain is not acceptig POST requests anymore + # using stg.packit.dev instead + keys = [ + "https://stg.packit.dev/api/webhooks/github", + ] sess = RequestResponseHandling(store_keys=keys) response = self.requests.post(*keys) sess.write(response) response_after = sess.read() self.assertIsInstance(response_after, self.requests.models.Response) - self.assertNotIn("Example Domain", str(sess.get_cassette().storage_object)) - self.assertIn("Example Domain", response_after.text) + self.assertNotIn( + "We haven't received any JSON data", str(sess.get_cassette().storage_object) + ) + self.assertIn("We haven't received any JSON data", response_after.text) @unittest.skipIf(not network_connection_available(), "No network connection") def testExecuteWrapper(self):