From 3ea09ad6fb834a4b168822f41b805357a08bc1b3 Mon Sep 17 00:00:00 2001 From: Philip Chase Date: Tue, 12 Dec 2023 22:07:53 -0500 Subject: [PATCH] Fix test of api/ url in test.py --- tests/test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test.py b/tests/test.py index 0711fe5..ad63ab6 100644 --- a/tests/test.py +++ b/tests/test.py @@ -1,6 +1,7 @@ import unittest import sys import re +import urllib.error try: from urllib.request import urlopen # Python3 @@ -75,7 +76,8 @@ def testApiFolder(self): localpath = "api/" self.fullpath=self.redcap_root + localpath expected_string = 'The requested method is not implemented.' - self.assertIn(expected_string, self.weburl.get(self.fullpath)) + with self.assertRaises(urllib.error.HTTPError) as cm: + self.weburl.get(self.fullpath) # deactivate the API Help tests as they are failing routinely in Shib and probably not relevant. # def testApiHelpFolder(self):