MCPcopy Index your code
hub / github.com/csev/py4e / test_real_xhtml_document

Method test_real_xhtml_document

code3/bs4/testing.py:566–576  ·  view source on GitHub ↗

A real XHTML document should come out *exactly* the same as it went in.

(self)

Source from the content-addressed store, hash-verified

564 self.assertEqual(markup, soup.encode("utf8"))
565
566 def test_real_xhtml_document(self):
567 """A real XHTML document should come out *exactly* the same as it went in."""
568 markup = b"""<?xml version="1.0" encoding="utf-8"?>
569<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
570<html xmlns="http://www.w3.org/1999/xhtml">
571<head><title>Hello.</title></head>
572<body>Goodbye.</body>
573</html>"""
574 soup = self.soup(markup)
575 self.assertEqual(
576 soup.encode("utf-8"), markup)
577
578 def test_formatter_processes_script_tag_for_xml_documents(self):
579 doc = """

Callers

nothing calls this directly

Calls 2

soupMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected