1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-08 16:53:23 +00:00

Store Headers as a List

This is a backwards-incompatible change that will store headers
as a list rather than a dictionary.  The reason being that you can
have multiple values for a single header, and concatenating them
together with commas can create an unparseable string (sometimes
the header values can have commas in them)
This commit is contained in:
Kevin McCarthy
2013-12-07 15:50:30 -10:00
parent 144d25bc66
commit 624212ef15
2 changed files with 30 additions and 13 deletions

View File

@@ -52,3 +52,20 @@ def test_flickr_should_respond_with_200(tmpdir):
with vcr.use_cassette(testfile):
r = requests.post("http://api.flickr.com/services/upload")
assert r.status_code == 200
def x_test_zip_file(tmpdir):
# TODO: How do I make this pass?
zipfile = "http://www.colorado.edu/conflict/peace/download/peace_example.ZIP"
testfile = str(tmpdir.join('test.json'))
with vcr.use_cassette(testfile, serializer='json'):
r = requests.post(zipfile)
def test_cookies(tmpdir):
testfile = str(tmpdir.join('cookies.yml'))
with vcr.use_cassette(testfile):
s = requests.Session()
r1 = s.get("http://httpbin.org/cookies/set?k1=v1&k2=v2")
r2 = s.get("http://httpbin.org/cookies")
assert len(r2.json()['cookies']) == 2