MCPcopy Index your code
hub / github.com/python/cpython / test_bad_8bit_header

Method test_bad_8bit_header

Lib/test/test_email/test_email.py:5285–5295  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

5283 eq(h.encode(), '=?utf-8?b?6I+K5Zyw5pmC5aSr?=')
5284
5285 def test_bad_8bit_header(self):
5286 raises = self.assertRaises
5287 eq = self.assertEqual
5288 x = b'Ynwp4dUEbay Auction Semiar- No Charge \x96 Earn Big'
5289 raises(UnicodeError, Header, x)
5290 h = Header()
5291 raises(UnicodeError, h.append, x)
5292 e = x.decode('utf-8', 'replace')
5293 eq(str(Header(x, errors='replace')), e)
5294 h.append(x, errors='replace')
5295 eq(str(h), e)
5296
5297 def test_escaped_8bit_header(self):
5298 x = b'Ynwp4dUEbay Auction Semiar- No Charge \x96 Earn Big'

Callers

nothing calls this directly

Calls 6

appendMethod · 0.95
HeaderClass · 0.90
raisesFunction · 0.85
eqFunction · 0.85
strFunction · 0.85
decodeMethod · 0.45

Tested by

no test coverage detected