@@ -87,7 +87,7 @@ def it_raises_an_unexpected_typed_error(self):
87
87
}
88
88
content = json .dumps (payload ).encode ('utf-8' )
89
89
resp = mock_response (content )
90
- with patch ('requests.request' ) as mock_method :
90
+ with patch ('requests.sessions.Session. request' ) as mock_method :
91
91
mock_method .return_value = resp
92
92
try :
93
93
self .client .get ('/users' , {})
@@ -109,7 +109,7 @@ def it_raises_an_unexpected_untyped_error(self):
109
109
}
110
110
content = json .dumps (payload ).encode ('utf-8' )
111
111
resp = mock_response (content )
112
- with patch ('requests.request' ) as mock_method :
112
+ with patch ('requests.sessions.Session. request' ) as mock_method :
113
113
mock_method .return_value = resp
114
114
try :
115
115
self .client .get ('/users' , {})
@@ -135,7 +135,7 @@ def it_raises_a_bad_request_error(self):
135
135
136
136
content = json .dumps (payload ).encode ('utf-8' )
137
137
resp = mock_response (content )
138
- with patch ('requests.request' ) as mock_method :
138
+ with patch ('requests.sessions.Session .request' ) as mock_method :
139
139
mock_method .return_value = resp
140
140
with assert_raises (intercom .BadRequestError ):
141
141
self .client .get ('/users' , {})
@@ -156,7 +156,7 @@ def it_raises_an_authentication_error(self):
156
156
157
157
content = json .dumps (payload ).encode ('utf-8' )
158
158
resp = mock_response (content )
159
- with patch ('requests.request' ) as mock_method :
159
+ with patch ('requests.sessions.Session. request' ) as mock_method :
160
160
mock_method .return_value = resp
161
161
with assert_raises (intercom .AuthenticationError ):
162
162
self .client .get ('/users' , {})
@@ -174,7 +174,7 @@ def it_raises_resource_not_found_by_type(self):
174
174
}
175
175
content = json .dumps (payload ).encode ('utf-8' )
176
176
resp = mock_response (content )
177
- with patch ('requests.request' ) as mock_method :
177
+ with patch ('requests.sessions.Session. request' ) as mock_method :
178
178
mock_method .return_value = resp
179
179
with assert_raises (intercom .ResourceNotFound ):
180
180
self .client .get ('/users' , {})
@@ -192,7 +192,7 @@ def it_raises_rate_limit_exceeded(self):
192
192
}
193
193
content = json .dumps (payload ).encode ('utf-8' )
194
194
resp = mock_response (content )
195
- with patch ('requests.request' ) as mock_method :
195
+ with patch ('requests.sessions.Session. request' ) as mock_method :
196
196
mock_method .return_value = resp
197
197
with assert_raises (intercom .RateLimitExceeded ):
198
198
self .client .get ('/users' , {})
@@ -210,7 +210,7 @@ def it_raises_a_service_unavailable_error(self):
210
210
}
211
211
content = json .dumps (payload ).encode ('utf-8' )
212
212
resp = mock_response (content )
213
- with patch ('requests.request' ) as mock_method :
213
+ with patch ('requests.sessions.Session. request' ) as mock_method :
214
214
mock_method .return_value = resp
215
215
with assert_raises (intercom .ServiceUnavailableError ):
216
216
self .client .get ('/users' , {})
@@ -228,7 +228,7 @@ def it_raises_a_multiple_matching_users_error(self):
228
228
}
229
229
content = json .dumps (payload ).encode ('utf-8' )
230
230
resp = mock_response (content )
231
- with patch ('requests.request' ) as mock_method :
231
+ with patch ('requests.sessions.Session. request' ) as mock_method :
232
232
mock_method .return_value = resp
233
233
with assert_raises (intercom .MultipleMatchingUsersError ):
234
234
self .client .get ('/users' , {})
@@ -246,7 +246,7 @@ def it_raises_token_unauthorized(self):
246
246
}
247
247
content = json .dumps (payload ).encode ('utf-8' )
248
248
resp = mock_response (content )
249
- with patch ('requests.request' ) as mock_method :
249
+ with patch ('requests.sessions.Session. request' ) as mock_method :
250
250
mock_method .return_value = resp
251
251
with assert_raises (intercom .TokenUnauthorizedError ):
252
252
self .client .get ('/users' , {})
@@ -265,7 +265,7 @@ def it_handles_no_error_type(self):
265
265
}
266
266
content = json .dumps (payload ).encode ('utf-8' )
267
267
resp = mock_response (content )
268
- with patch ('requests.request' ) as mock_method :
268
+ with patch ('requests.sessions.Session. request' ) as mock_method :
269
269
mock_method .return_value = resp
270
270
with assert_raises (intercom .MultipleMatchingUsersError ):
271
271
self .client .get ('/users' , {})
@@ -282,7 +282,7 @@ def it_handles_no_error_type(self):
282
282
}
283
283
content = json .dumps (payload ).encode ('utf-8' )
284
284
resp = mock_response (content )
285
- with patch ('requests.request' ) as mock_method :
285
+ with patch ('requests.sessions.Session. request' ) as mock_method :
286
286
mock_method .return_value = resp
287
287
with assert_raises (intercom .BadRequestError ):
288
288
self .client .get ('/users' , {})
0 commit comments