diff options
author | Leonard Richardson <leonardr@segfault.org> | 2015-07-05 13:21:00 -0400 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2015-07-05 13:21:00 -0400 |
commit | 0d5e476b466abb48766c48693d7b37ce570d9d1b (patch) | |
tree | 0d37c128d08b7da708a9abe201ebe1db5601e766 | |
parent | c0ef434959d1a786f6abebf54b6b3202f2c5c87c (diff) |
Fixed the test_detect_utf8 test so that it works when chardet is
installed. [bug=1471359]
-rw-r--r-- | NEWS.txt | 5 | ||||
-rw-r--r-- | bs4/tests/test_soup.py | 5 |
2 files changed, 8 insertions, 2 deletions
@@ -1,3 +1,8 @@ += Unreleased + +* Fixed the test_detect_utf8 test so that it works when chardet is + installed. [bug=1471359] + = 4.4.0 (20150703) = Especially important changes: diff --git a/bs4/tests/test_soup.py b/bs4/tests/test_soup.py index 3643aed..1238af2 100644 --- a/bs4/tests/test_soup.py +++ b/bs4/tests/test_soup.py @@ -299,10 +299,11 @@ class TestUnicodeDammit(unittest.TestCase): dammit.unicode_markup, """<foo>''""</foo>""") def test_detect_utf8(self): - utf8 = b"\xc3\xa9" + utf8 = b"Sacr\xc3\xa9 bleu! \xe2\x98\x83" dammit = UnicodeDammit(utf8) - self.assertEqual(dammit.unicode_markup, u'\xe9') self.assertEqual(dammit.original_encoding.lower(), 'utf-8') + self.assertEqual(dammit.unicode_markup, u'Sacr\xe9 bleu! \N{SNOWMAN}') + def test_convert_hebrew(self): hebrew = b"\xed\xe5\xec\xf9" |