def testContentTypeWithoutCharset(self): """Typical Content-Type with no charset can be parsed.""" ct = 'text/xml' contentType, charset = tumblr._parse_content_type(ct) assert (contentType == 'text/xml') and (charset is None)
def testContentTypeAndCharset(self): """Typical Content-Type with charset can be parsed.""" ct = 'application/xml; charset=utf-8' contentType, charset = tumblr._parse_content_type(ct) assert (contentType == 'application/xml') and (charset == 'utf-8')