def test_htmlencoding_nonentities(self): """tests to give us full coverage""" for encoded, real in [("Some &; text", "Some &; text"), ("© ", "© "), ("&rogerrabbit;", "&rogerrabbit;"), ]: assert quote.htmlentitydecode(encoded) == real
def test_htmlencoding_nonentities(self): """tests to give us full coverage""" for encoded, real in [(u"Some &; text", u"Some &; text"), (u"© ", u"© "), (u"&rogerrabbit;", u"&rogerrabbit;"), ]: assert quote.htmlentitydecode(encoded) == real
def test_htmlencoding_nonentities(): """tests to give us full coverage""" for encoded, real in [ ("Some &; text", "Some &; text"), ("© ", "© "), ("©", "©"), ("&rogerrabbit;", "&rogerrabbit;"), ]: assert quote.htmlentitydecode(encoded) == real for decoded, real in [ ("Some &; text", "Some &; text"), ("© ", "&copy "), ("©", "&copy"), ("&rogerrabbit;", "&rogerrabbit;"), ]: assert quote.htmlentityencode(decoded) == real
def _html_encoding_helper(pairs): for from_, to in pairs: assert quote.htmlentityencode(from_) == to assert quote.htmlentitydecode(to) == from_
def _html_encoding_helper(self, pairs): for from_, to in pairs: assert quote.htmlentityencode(from_) == to assert quote.htmlentitydecode(to) == from_
def test_htmlencoding(self): """test that we can encode and decode HTML entities""" raw_encoded = [(u"€", "€"), (u"©", "©"), (u'"', """)] for raw, encoded in raw_encoded: assert quote.htmlentityencode(raw) == encoded assert quote.htmlentitydecode(encoded) == raw