Testing several problematic XML files, none should be formatted and none should make HTTPie to crash.
(file)
| 83 | @pytest.mark.parametrize('file', XML_FILES_INVALID) |
| 84 | @responses.activate |
| 85 | def 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 |