MCPcopy Index your code
hub / github.com/RustPython/RustPython / setUp

Method setUp

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

Source from the content-addressed store, hash-verified

4703
4704class TestQuopri(unittest.TestCase):
4705 def setUp(self):
4706 # Set of characters (as byte integers) that don't need to be encoded
4707 # in headers.
4708 self.hlit = list(chain(
4709 range(ord('a'), ord('z') + 1),
4710 range(ord('A'), ord('Z') + 1),
4711 range(ord('0'), ord('9') + 1),
4712 (c for c in b'!*+-/')))
4713 # Set of characters (as byte integers) that do need to be encoded in
4714 # headers.
4715 self.hnon = [c for c in range(256) if c not in self.hlit]
4716 assert len(self.hlit) + len(self.hnon) == 256
4717 # Set of characters (as byte integers) that don't need to be encoded
4718 # in bodies.
4719 self.blit = list(range(ord(' '), ord('~') + 1))
4720 self.blit.append(ord('\t'))
4721 self.blit.remove(ord('='))
4722 # Set of characters (as byte integers) that do need to be encoded in
4723 # bodies.
4724 self.bnon = [c for c in range(256) if c not in self.blit]
4725 assert len(self.blit) + len(self.bnon) == 256
4726
4727 def test_quopri_header_check(self):
4728 for c in self.hlit:

Callers

nothing calls this directly

Calls 5

listClass · 0.85
ordFunction · 0.85
lenFunction · 0.85
appendMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected