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

Added migration for Request headers to be a dict of lists

This commit is contained in:
Max Shytikov
2014-04-30 01:43:47 +02:00
parent eab10578d5
commit fbb6382c12

View File

@@ -47,6 +47,10 @@ def migrate_json(in_fp, out_fp):
req = item['request']
uri = dict((k, req.pop(k)) for k in PARTS)
req['uri'] = build_uri(**uri)
# convert headers to dict of lists
headers = req['headers']
for k in headers:
headers[k] = [headers[k]]
json.dump(data, out_fp, indent=4)
@@ -87,6 +91,12 @@ def migrate_yml(in_fp, out_fp):
req.__dict__['path'],
)
# convert headers to dict of lists
headers = req.headers
req.headers = {}
for key, value in headers:
req.add_header(key, value)
data = yamlserializer.serialize({
"requests": requests,
"responses": responses,