mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-08 16:53:23 +00:00
Fix Requests so it can gunzip the request body
I wasn't emulating the stateful file-object in my response stub, so urllib3 wasn't decompressing gzipped bodies properly. This should fix that problem. Thanks @bryanhelmig for the motivation to dig into this.
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
import json
|
||||
|
||||
|
||||
def assert_cassette_empty(cass):
|
||||
assert len(cass) == 0
|
||||
assert cass.play_count == 0
|
||||
@@ -6,3 +9,11 @@ def assert_cassette_empty(cass):
|
||||
def assert_cassette_has_one_response(cass):
|
||||
assert len(cass) == 1
|
||||
assert cass.play_count == 1
|
||||
|
||||
|
||||
def assert_is_json(a_string):
|
||||
try:
|
||||
json.loads(a_string)
|
||||
except Exception:
|
||||
assert False
|
||||
assert True
|
||||
|
||||
Reference in New Issue
Block a user