From 0fe84d4d409273b6fadefe85e328e569b3296cfe Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Sat, 30 Jul 2016 07:55:09 -0400 Subject: Explained why we test both unicode and bytestring processing instructions. --- bs4/testing.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'bs4/testing.py') diff --git a/bs4/testing.py b/bs4/testing.py index 387f775..3a6ed42 100644 --- a/bs4/testing.py +++ b/bs4/testing.py @@ -139,6 +139,14 @@ class HTMLTreeBuilderSmokeTest(object): markup.replace(b"\n", b"")) def test_processing_instruction(self): + # We test both Unicode and bytestring to verify that + # process_markup correctly sets processing_instruction_class + # even when the markup is already Unicode and there is no + # need to process anything. + markup = u"""""" + soup = self.soup(markup) + self.assertEqual(markup, soup.decode()) + markup = b"""""" soup = self.soup(markup) self.assertEqual(markup, soup.encode("utf8")) -- cgit v1.2.3