MCPcopy Index your code
hub / github.com/httpie/cli / test_invalid_xml

Function test_invalid_xml

tests/test_xml.py:85–99  ·  view source on GitHub ↗

Testing several problematic XML files, none should be formatted and none should make HTTPie to crash.

(file)

Source from the content-addressed store, hash-verified

83@pytest.mark.parametrize('file', XML_FILES_INVALID)
84@responses.activate
85def test_invalid_xml(file):
86 """Testing several problematic XML files, none should be formatted
87 and none should make HTTPie to crash.
88 """
89 xml_data = file.read_text(encoding=UTF8)
90 responses.add(
91 responses.GET,
92 DUMMY_URL,
93 body=xml_data,
94 content_type='application/xml',
95 )
96
97 # No formatting done, data is simply printed as-is.
98 r = http(DUMMY_URL)
99 assert xml_data in r

Callers

nothing calls this directly

Calls 2

httpFunction · 0.85
addMethod · 0.80

Tested by

no test coverage detected