(self)
| 51 | self.assertIsInstance(builder, xmlbuilder.DOMBuilder) |
| 52 | |
| 53 | def test_parse_uri(self): |
| 54 | body = ( |
| 55 | b"HTTP/1.1 200 OK\r\nContent-Type: text/xml; charset=utf-8\r\n\r\n" |
| 56 | + SMALL_SAMPLE |
| 57 | ) |
| 58 | |
| 59 | sock = FakeSocket(body) |
| 60 | response = client.HTTPResponse(sock) |
| 61 | response.begin() |
| 62 | attrs = {"open.return_value": response} |
| 63 | opener = mock.Mock(**attrs) |
| 64 | |
| 65 | with mock.patch("urllib.request.build_opener") as mock_build: |
| 66 | mock_build.return_value = opener |
| 67 | |
| 68 | imp = getDOMImplementation() |
| 69 | builder = imp.createDOMBuilder(imp.MODE_SYNCHRONOUS, None) |
| 70 | document = builder.parseURI("http://example.com/2000/svg") |
| 71 | |
| 72 | self.assertIsInstance(document, minidom.Document) |
| 73 | self.assertEqual(len(document.childNodes), 1) |
| 74 | |
| 75 | def test_parse_with_systemId(self): |
| 76 | response = io.BytesIO(SMALL_SAMPLE) |
nothing calls this directly
no test coverage detected