MCPcopy Index your code
hub / github.com/python/cpython / test_parse_with_systemId

Method test_parse_with_systemId

Lib/test/test_xml_dom_xmlbuilder.py:75–88  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

73 self.assertEqual(len(document.childNodes), 1)
74
75 def test_parse_with_systemId(self):
76 response = io.BytesIO(SMALL_SAMPLE)
77
78 with mock.patch("urllib.request.urlopen") as mock_open:
79 mock_open.return_value = response
80
81 imp = getDOMImplementation()
82 source = imp.createDOMInputSource()
83 builder = imp.createDOMBuilder(imp.MODE_SYNCHRONOUS, None)
84 source.systemId = "http://example.com/2000/svg"
85 document = builder.parse(source)
86
87 self.assertIsInstance(document, minidom.Document)
88 self.assertEqual(len(document.childNodes), 1)

Callers

nothing calls this directly

Calls 6

getDOMImplementationFunction · 0.90
createDOMInputSourceMethod · 0.80
createDOMBuilderMethod · 0.80
assertIsInstanceMethod · 0.80
parseMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected