MCPcopy
hub / github.com/csev/py4e / test_real_xhtml_document

Method test_real_xhtml_document

code3/bs4/testing.py:126–137  ·  view source on GitHub ↗

A real XHTML document should come out more or less the same as it went in.

(self)

Source from the content-addressed store, hash-verified

124 self.assertDoctypeHandled('xsl:stylesheet PUBLIC "htmlent.dtd"')
125
126 def test_real_xhtml_document(self):
127 """A real XHTML document should come out more or less the same as it went in."""
128 markup = b"""<?xml version="1.0" encoding="utf-8"?>
129<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
130<html xmlns="http://www.w3.org/1999/xhtml">
131<head><title>Hello.</title></head>
132<body>Goodbye.</body>
133</html>"""
134 soup = self.soup(markup)
135 self.assertEqual(
136 soup.encode("utf-8").replace(b"\n", b""),
137 markup.replace(b"\n", b""))
138
139 def test_processing_instruction(self):
140 markup = b"""<?PITarget PIContent?>"""

Callers

nothing calls this directly

Calls 2

soupMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected