From 77823a9c122331e24496c75be34c6365b2bf37b0 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 15 Feb 2024 16:01:32 +0100 Subject: [PATCH] Fix more unit-tests II. related to internal ticket CURA-11406 --- tests/TestOAuth2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/TestOAuth2.py b/tests/TestOAuth2.py index c7985e39f3..41edaebbf7 100644 --- a/tests/TestOAuth2.py +++ b/tests/TestOAuth2.py @@ -120,7 +120,7 @@ def test__parseJWTFailOnRefresh(): mock_reply.error = Mock(return_value = QNetworkReply.NetworkError.AuthenticationRequiredError) # The reply is 403: Authentication required, meaning the server responded with a "Can't do that, Dave". http_mock = Mock() http_mock.get = lambda url, headers_dict, callback, error_callback, timeout: callback(mock_reply) - http_mock.post = lambda url, data, headers_dict, callback, error_callback, timeout: callback(mock_reply) + http_mock.post = lambda url, data, headers_dict, callback, error_callback, urgent, timeout: callback(mock_reply) with patch("UM.TaskManagement.HttpRequestManager.HttpRequestManager.readJSON", Mock(return_value = {"error_description": "Mock a failed request!"})): with patch("UM.TaskManagement.HttpRequestManager.HttpRequestManager.getInstance", MagicMock(return_value = http_mock)): @@ -182,7 +182,7 @@ def test_refreshAccessTokenFailed(): mock_reply.error = Mock(return_value = QNetworkReply.NetworkError.AuthenticationRequiredError) # The reply is 403: Authentication required, meaning the server responded with a "Can't do that, Dave". http_mock = Mock() http_mock.get = lambda url, headers_dict, callback, error_callback, timeout: callback(mock_reply) - http_mock.post = lambda url, data, headers_dict, callback, error_callback, timeout: callback(mock_reply) + http_mock.post = lambda url, data, headers_dict, callback, error_callback, urgent, timeout: callback(mock_reply) with patch("UM.TaskManagement.HttpRequestManager.HttpRequestManager.readJSON", Mock(return_value = {"error_description": "Mock a failed request!"})): with patch("UM.TaskManagement.HttpRequestManager.HttpRequestManager.getInstance", MagicMock(return_value = http_mock)):