@@ -49,18 +49,6 @@ def close(self):
49
49
raise CloseMethodCalled ("Not used by MSAL, but our customers may use it" )
50
50
51
51
52
- class DummyHttpClientWithoutResponseHeaders (DummyHttpClient ):
53
- def post (self , url , params = None , data = None , headers = None , ** kwargs ):
54
- response = super ().post (url , params , data , headers , ** kwargs )
55
- del response .headers # Early versions of MSAL did not require http client to return headers
56
- return response
57
-
58
- def get (self , url , params = None , headers = None , ** kwargs ):
59
- response = super ().get (url , params , headers , ** kwargs )
60
- del response .headers # Early versions of MSAL did not require http client to return headers
61
- return response
62
-
63
-
64
52
class CloseMethodCalled (Exception ):
65
53
pass
66
54
@@ -82,9 +70,10 @@ def test_pickled_minimal_response_should_contain_signature(self):
82
70
status_code = 200 , headers = {}, text = "foo" )))
83
71
84
72
def test_throttled_http_client_base_response_should_tolerate_headerless_response (self ):
85
- http_client = ThrottledHttpClientBase (DummyHttpClientWithoutResponseHeaders (
86
- status_code = 200 , response_text = "foo" ))
87
- response = http_client .post ("https://example.com" )
73
+ http_client = DummyHttpClient (status_code = 200 , response_text = "foo" )
74
+ raw_response = http_client .post ("https://example.com" )
75
+ self .assertFalse (hasattr (raw_response , "headers" ), "Should not contain headers" )
76
+ response = ThrottledHttpClientBase (http_client ).post ("https://example.com" )
88
77
self .assertEqual (response .text , "foo" , "Should return the same response text" )
89
78
90
79
def test_throttled_http_client_base_response_should_not_contain_signature (self ):
0 commit comments