Example #1
0
 def test_wrong_format_input_raises(self):
     with self.assertRaises(ValueError):
         _ew.decode('=?badone?=')
     with self.assertRaises(ValueError):
         _ew.decode('=?')
     with self.assertRaises(ValueError):
         _ew.decode('')
 def test_wrong_format_input_raises(self):
     with self.assertRaises(ValueError):
         _ew.decode('=?badone?=')
     with self.assertRaises(ValueError):
         _ew.decode('=?')
     with self.assertRaises(ValueError):
         _ew.decode('')
Example #3
0
 def _test(self, source, result, charset='us-ascii', lang='', defects=[]):
     res, char, l, d = _ew.decode(source)
     self.assertEqual(res, result)
     self.assertEqual(char, charset)
     self.assertEqual(l, lang)
     self.assertDefectsEqual(d, defects)
 def _test(self, source, result, charset='us-ascii', lang='', defects=[]):
     res, char, l, d = _ew.decode(source)
     self.assertEqual(res, result)
     self.assertEqual(char, charset)
     self.assertEqual(l, lang)
     self.assertDefectsEqual(d, defects)