Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)