You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
assert resp.json() == {"message": "There you go!"}
257
+
258
+
228
259
Example of how to record real socket traffic
229
260
============================================
230
261
@@ -251,10 +282,12 @@ You probably know what *VCRpy* is capable of, that's the *mocket*'s way of achie
251
282
252
283
HTTPretty compatibility layer
253
284
=============================
254
-
Mocket HTTP mock can work as *HTTPretty* replacement for many different use cases. Two main features are missing:
285
+
Mocket HTTP mock can work as *HTTPretty* replacement for many different use cases. Two main features are missing, or better said, are implemented differently:
286
+
287
+
- URL entries containing regular expressions, *Mocket* implements `can_handle_fun` which is way simpler to use and more powerful;
288
+
- response body from functions (used mostly to fake errors, *Mocket* accepts an `exception` instead).
255
289
256
-
- URL entries containing regular expressions;
257
-
- response body from functions (used mostly to fake errors, *mocket* doesn't need to do it this way).
290
+
Both features are documented above.
258
291
259
292
Two features which are against the Zen of Python, at least imho (*mindflayer*), but of course I am open to call it into question.
0 commit comments