예제 #1
0
 def test_utf8_invalid(self):
     '''Test that we return False with non-utf8 chars'''
     warnings.simplefilter('ignore', DeprecationWarning)
     tools.ok_(utf8.utf8_valid(b'\xff') == False)
     tools.ok_(utf8.utf8_valid(self.latin1_spanish) == False)
     warnings.simplefilter('default', DeprecationWarning)
예제 #2
0
 def test_utf8_invalid(self):
     '''Test that we return False with non-utf8 chars'''
     warnings.simplefilter('ignore', DeprecationWarning)
     tools.ok_(utf8.utf8_valid(b'\xff') == False)
     tools.ok_(utf8.utf8_valid(self.latin1_spanish) == False)
     warnings.simplefilter('default', DeprecationWarning)
예제 #3
0
 def test_utf8_valid(self):
     '''Test that a utf8 byte sequence is validated'''
     warnings.simplefilter('ignore', DeprecationWarning)
     tools.ok_(utf8.utf8_valid(self.utf8_japanese) == True)
     tools.ok_(utf8.utf8_valid(self.utf8_spanish) == True)
     warnings.simplefilter('default', DeprecationWarning)
예제 #4
0
 def test_utf8_valid(self):
     '''Test that a utf8 byte sequence is validated'''
     warnings.simplefilter('ignore', DeprecationWarning)
     tools.ok_(utf8.utf8_valid(self.utf8_japanese) == True)
     tools.ok_(utf8.utf8_valid(self.utf8_spanish) == True)
     warnings.simplefilter('default', DeprecationWarning)