MCPcopy
hub / github.com/aosabook/500lines / test_charset

Method test_charset

crawler/code/test.py:299–307  ·  view source on GitHub ↗
(charset, encoding)

Source from the content-addressed store, hash-verified

297
298 def test_encoding(self):
299 def test_charset(charset, encoding):
300 if charset:
301 content_type = 'text/html; charset={}'.format(charset)
302 else:
303 content_type = 'text/html'
304 url = '/' + charset
305 self.add_page(url, content_type=content_type)
306 self.crawl([self.app_url + url])
307 self.assertStat(encoding=encoding)
308
309 test_charset('', 'utf-8')
310 test_charset('utf-8', 'utf-8')

Callers

nothing calls this directly

Calls 3

add_pageMethod · 0.95
crawlMethod · 0.95
assertStatMethod · 0.95

Tested by

no test coverage detected