Exemple #1
0
 def test_utf8_default(self):
     self.assertEqual(_ew.encode('foo'), '=?utf-8?q?foo?=')
Exemple #2
0
 def test_auto_b_if_long_unsafe(self):
     self.assertEqual(_ew.encode('vi.vi.vi.vi.vi.', 'utf-8'),
                      '=?utf-8?b?dmkudmkudmkudmkudmku?=')
Exemple #3
0
 def test_auto_q_if_long_mostly_safe(self):
     self.assertEqual(_ew.encode('vi vi vi.vi ', 'utf-8'),
                      '=?utf-8?q?vi_vi_vi=2Evi_?=')
Exemple #4
0
 def test_auto_q_if_short_mostly_safe(self):
     self.assertEqual(_ew.encode('vi.', 'utf-8'), '=?utf-8?q?vi=2E?=')
Exemple #5
0
 def test_auto_b_if_enough_unsafe(self):
     self.assertEqual(_ew.encode('.....', 'utf-8'), '=?utf-8?b?Li4uLi4=?=')
 def test_auto_q(self):
     self.assertEqual(_ew.encode('foo', 'utf-8'), '=?utf-8?q?foo?=')
Exemple #7
0
 def test_auto_q(self):
     self.assertEqual(_ew.encode('foo', 'utf-8'), '=?utf-8?q?foo?=')
 def test_lang(self):
     self.assertEqual(_ew.encode('foo', lang='jive'), '=?utf-8*jive?q?foo?=')
 def test_unknown_8bit(self):
     self.assertEqual(_ew.encode('foo\uDCACbar', charset='unknown-8bit'),
                      '=?unknown-8bit?q?foo=ACbar?=')
 def test_auto_q_if_long_mostly_safe(self):
     self.assertEqual(_ew.encode('vi vi vi.vi ', 'utf-8'),
                      '=?utf-8?q?vi_vi_vi=2Evi_?=')
 def test_utf8_default(self):
     self.assertEqual(_ew.encode('foo'), '=?utf-8?q?foo?=')
 def test_auto_b_if_long_unsafe(self):
     self.assertEqual(_ew.encode('vi.vi.vi.vi.vi.', 'utf-8'),
                      '=?utf-8?b?dmkudmkudmkudmkudmku?=')
 def test_auto_b_if_enough_unsafe(self):
     self.assertEqual(_ew.encode('.....', 'utf-8'), '=?utf-8?b?Li4uLi4=?=')
 def test_auto_q_if_short_mostly_safe(self):
     self.assertEqual(_ew.encode('vi.', 'utf-8'), '=?utf-8?q?vi=2E?=')
Exemple #15
0
 def test_lang(self):
     self.assertEqual(_ew.encode('foo', lang='jive'),
                      '=?utf-8*jive?q?foo?=')
Exemple #16
0
 def test_b(self):
     self.assertEqual(_ew.encode('foo', 'utf-8', 'b'), '=?utf-8?b?Zm9v?=')
Exemple #17
0
 def test_unknown_8bit(self):
     self.assertEqual(_ew.encode('foo\uDCACbar', charset='unknown-8bit'),
                      '=?unknown-8bit?q?foo=ACbar?=')
 def test_b(self):
     self.assertEqual(_ew.encode('foo', 'utf-8', 'b'), '=?utf-8?b?Zm9v?=')