Пример #1
0
 def test_is_valid_unicode(self):
     testcase_list = ((None, True), (1, True), (['foo'], True), ({
         'foo':
         b'bar'
     }, True), ('foo', True), (b'foo\x00', True), (b'foo\xf3\x02', False))
     for val, expected in testcase_list:
         self.assertEqual(_is_valid_unicode(val), expected)
Пример #2
0
 def test_is_valid_unicode(self):
     testcase_list = (
         (None, True),
         (1, True),
         (['foo'], True),
         ({'foo': b'bar'}, True),
         ('foo', True),
         (b'foo\x00', True),
         (b'foo\xf3\x02', False)
     )
     for val, expected in testcase_list:
         self.assertEqual(_is_valid_unicode(val), expected)
Пример #3
0
 def test_is_valid_unicode(self):
     testcase_list = (
         (None, True),
         (1, True),
         (["foo"], True),
         ({"foo": b"bar"}, True),
         ("foo", True),
         (b"foo\x00", True),
         (b"foo\xf3\x02", False),
     )
     for val, expected in testcase_list:
         self.assertEqual(_is_valid_unicode(val), expected)