diff options
author | Leonard Richardson <leonardr@segfault.org> | 2012-05-24 08:28:14 -0400 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2012-05-24 08:28:14 -0400 |
commit | 34c036cde4ed75e000be2d29f542a3f9ec215dfa (patch) | |
tree | f7da41504e50da02587ac4acd0d8a93ae2f50f70 /bs4/tests | |
parent | c84e08aa77764578ca1be2a322a4a7bed12d6851 (diff) |
Fixed a bug with the lxml treebuilder that prevented the user from adding attributes to a tag that didn't originally have any. [bug=1002378] Thanks to Oliver Beattie for the patch.
Diffstat (limited to 'bs4/tests')
-rw-r--r-- | bs4/tests/test_soup.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bs4/tests/test_soup.py b/bs4/tests/test_soup.py index ef58521..23a664e 100644 --- a/bs4/tests/test_soup.py +++ b/bs4/tests/test_soup.py @@ -286,7 +286,7 @@ class TestUnicodeDammit(unittest.TestCase): self.assertEqual(u"<a>áé</a>", dammit.unicode_markup) self.assertEqual("utf-16le", dammit.original_encoding) - def test_fix_embedded_windows_1252(self): + def test_detwingle(self): # Here's a UTF8 document. utf8 = (u"\N{SNOWMAN}" * 3).encode("utf8") @@ -306,11 +306,11 @@ class TestUnicodeDammit(unittest.TestCase): # But if we run it through fix_embedded_windows_1252, it's fixed: - fixed = UnicodeDammit.fix_embedded_windows_1252(doc) + fixed = UnicodeDammit.detwingle(doc) self.assertEqual( u"☃☃☃“Hi, I like Windows!”☃☃☃", fixed.decode("utf8")) - def test_fix_embedded_windows_1252_ignores_multibyte_characters(self): + def test_detwingle_ignores_multibyte_characters(self): # Each of these characters has a UTF-8 representation ending # in \x93. \x93 is a smart quote if interpreted as # Windows-1252. But our code knows to skip over multibyte @@ -322,7 +322,7 @@ class TestUnicodeDammit(unittest.TestCase): ): input = tricky_unicode_char.encode("utf8") self.assertTrue(input.endswith(b'\x93')) - output = UnicodeDammit.fix_embedded_windows_1252(input) + output = UnicodeDammit.detwingle(input) self.assertEqual(output, input) class TestNamedspacedAttribute(SoupTest): |