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

Function test_valid_xml

tests/test_xml.py:36–54  ·  view source on GitHub ↗

Test XML formatter limits with data containing comments, doctypes and other XML-specific subtles.

(file)

Source from the content-addressed store, hash-verified

34@pytest.mark.parametrize('file', XML_FILES_VALID)
35@responses.activate
36def test_valid_xml(file):
37 """Test XML formatter limits with data containing comments, doctypes
38 and other XML-specific subtles.
39 """
40 if 'standalone' in file.stem and sys.version_info < (3, 9):
41 pytest.skip('Standalone XML requires Python 3.9+')
42
43 xml_data = file.read_text(encoding=UTF8)
44 expected_xml_file = file.with_name(file.name.replace('_raw', '_formatted'))
45 expected_xml_output = expected_xml_file.read_text(encoding=UTF8)
46 responses.add(
47 responses.GET,
48 DUMMY_URL,
49 body=xml_data,
50 content_type='application/xml',
51 )
52
53 r = http(DUMMY_URL)
54 assert expected_xml_output in r
55
56
57@responses.activate

Callers

nothing calls this directly

Calls 2

httpFunction · 0.85
addMethod · 0.80

Tested by

no test coverage detected