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(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)