Merge branch 'fix-268' of https://github.com/asnelzin/httpie into asnelzin-fix-268

This commit is contained in:
Jakub Roztocil 2015-01-23 21:45:09 +01:00
commit 22c993bab8
2 changed files with 6 additions and 1 deletions

View File

@ -640,7 +640,7 @@ def parse_items(items,
if item.sep in SEP_GROUP_RAW_JSON_ITEMS:
try:
value = json.loads(value)
value = json.loads(value, object_pairs_hook=OrderedDict)
except ValueError as e:
raise ParseError('"%s": %s' % (item.orig, e))
target = data

View File

@ -63,3 +63,8 @@ class TestHTTPie:
assert HTTP_OK in r
assert '"User-Agent": "HTTPie' in r, r
assert '"Foo": "bar"' in r
def test_json_order(self, httpbin):
r = http('PATCH', httpbin.url + '/patch', 'order:={"map":{"1":"first","2":"second"}}')
assert HTTP_OK in r
assert r.json['data'] == '{"order": {"map": {"1": "first", "2": "second"}}}'