Пример #1
0
 def test_supports_surrogates(self):
     bytes_with_surrogates = '\ud83d\ude4f'.encode('utf-8', 'surrogatepass')
     assert str_to_bytes(u'\ud83d\ude4f') == bytes_with_surrogates
Пример #2
0
 def test_from_unicode(self):
     assert isinstance(str_to_bytes(u'foo'), bytes)
Пример #3
0
 def test_from_bytes(self):
     assert isinstance(str_to_bytes(b'foo'), bytes)
Пример #4
0
 def test_from_bytes(self):
     assert isinstance(str_to_bytes(b'foo'), bytes)
Пример #5
0
 def test_supports_surrogates(self):
     bytes_with_surrogates = '\ud83d\ude4f'.encode('utf-8', 'surrogatepass')
     assert str_to_bytes('\ud83d\ude4f') == bytes_with_surrogates
Пример #6
0
 def test_from_unicode(self):
     assert isinstance(str_to_bytes('foo'), bytes)
Пример #7
0
 def test_from_bytes(self):
     self.assertIsInstance(str_to_bytes(b'foo'), bytes)
Пример #8
0
 def test_from_unicode(self):
     self.assertIsInstance(str_to_bytes('foo'), bytes)
Пример #9
0
 def test_from_bytes(self):
     self.assertIsInstance(str_to_bytes(b'foo'), bytes)
Пример #10
0
 def test_from_unicode(self):
     self.assertIsInstance(str_to_bytes('foo'), bytes)