From beffc8ad32ba309490c9e6ea23c8676c54b48ee9 Mon Sep 17 00:00:00 2001 From: Godmar Back Date: Fri, 23 Apr 2021 09:57:20 -0400 Subject: [PATCH] allow both 400 and 403 in test_access_control_private_valid_semantic_token --- tests/server_unit_test_pserv.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/server_unit_test_pserv.py b/tests/server_unit_test_pserv.py index c67ae8b..70d6fcc 100755 --- a/tests/server_unit_test_pserv.py +++ b/tests/server_unit_test_pserv.py @@ -1594,7 +1594,9 @@ class Access_Control(Doc_Print_Test_Case): raise AssertionError("The server did not respond within 2s") # Ensure that the user is not authenticated - self.assertEqual(response.status_code, requests.codes.bad_request, "Authentication failed.") + # accepted responses include 400 and 403 + if response.status_code not in [requests.codes.bad_request, requests.codes.forbidden]: + raise AssertionError("Server did not respond with 403 or 400 to missing authentication info") # Define the private URL to get url = 'http://%s:%s/%s' % (self.hostname, self.port, self.private_file)