def test_unescape_invalid(): entity = "&foobar;" assert unescape(entity) == entity
def test_unescape_int(): entity = " " assert unescape(entity) == u"\xa0"
def test_unescape_hex(): entity = " " assert unescape(entity) == u"\xa0"
def test_unescape_invalid_hex(): entity = "&#xzz;" assert unescape(entity) == entity
def test_unescape(entity, expected): actual = unescape(entity) assert actual == expected