def test_is_native_thai(self): self.assertEqual(is_native_thai(None), False) self.assertEqual(is_native_thai(""), False) self.assertEqual(is_native_thai("116"), False) self.assertEqual(is_native_thai("abc"), False) self.assertEqual(is_native_thai("ตา"), True) self.assertEqual(is_native_thai("ยา"), True) self.assertEqual(is_native_thai("ฆ่า"), True) self.assertEqual(is_native_thai("คน"), True) self.assertEqual(is_native_thai("กะ"), True) self.assertEqual(is_native_thai("มอ"), True) self.assertEqual(is_native_thai("กะ"), True) self.assertEqual(is_native_thai("กระ"), True) self.assertEqual(is_native_thai("ประท้วง"), True) self.assertEqual(is_native_thai("ศา"), False) self.assertEqual(is_native_thai("ลักษ์"), False) self.assertEqual(is_native_thai("มาร์ค"), False) self.assertEqual(is_native_thai("เลข"), False) self.assertEqual(is_native_thai("เทเวศน์"), False) self.assertEqual(is_native_thai("เทเวศร์"), False) # Commented out until this unittest bug get fixed: # https://bugs.python.org/issue29620 # with self.assertWarns(DeprecationWarning): # thaicheck("เลข") self.assertEqual(thaicheck("เลข"), is_native_thai("เลข"))
def test_is_thaicheck(self): self.assertEqual(thaicheck("ตา"), True) self.assertEqual(thaicheck("ยา"), True) self.assertEqual(thaicheck("ฆ่า"), True) self.assertEqual(thaicheck("คน"), True) self.assertEqual(thaicheck("กะ"), True) self.assertEqual(thaicheck("มอ"), True) self.assertEqual(thaicheck("มาร์ค"), False) self.assertEqual(thaicheck("เลข"), False) self.assertEqual(thaicheck("กะ"), True) self.assertEqual(thaicheck("ศา"), False) self.assertEqual(thaicheck("abc"), False) self.assertEqual(thaicheck("ลักษ์"), False)