MCPcopy
hub / github.com/httpie/cli / test_duplicate_keys_support_from_response

Function test_duplicate_keys_support_from_response

tests/test_json.py:95–112  ·  view source on GitHub ↗

JSON with duplicate keys should be handled correctly.

()

Source from the content-addressed store, hash-verified

93
94@responses.activate
95def test_duplicate_keys_support_from_response():
96 """JSON with duplicate keys should be handled correctly."""
97 responses.add(
98 responses.GET,
99 DUMMY_URL,
100 body=JSON_WITH_DUPES_RAW,
101 content_type='application/json',
102 )
103 args = ('--pretty', 'format', DUMMY_URL)
104
105 # Check implicit --sorted
106 if JsonDictPreservingDuplicateKeys.SUPPORTS_SORTING:
107 r = http(*args)
108 assert JSON_WITH_DUPES_FORMATTED_SORTED in r
109
110 # Check --unsorted
111 r = http(*args, '--unsorted')
112 assert JSON_WITH_DUPES_FORMATTED_UNSORTED in r
113
114
115def test_duplicate_keys_support_from_input_file():

Callers

nothing calls this directly

Calls 2

httpFunction · 0.85
addMethod · 0.80

Tested by

no test coverage detected