@@ -854,10 +854,11 @@ def testParseMultipleOneof(self, message_module):
854854 # itself for string fields. It also demonstrates escaped binary data.
855855 # The ur"" string prefix is unfortunately missing from Python 3
856856 # so we resort to double escaping our \s so that they come through.
857- _UNICODE_SAMPLE = u """
857+ _UNICODE_SAMPLE = """
858858 optional_bytes: 'Á short desçription'
859859 optional_string: 'Á short desçription'
860860 repeated_bytes: '\\ 303\\ 201 short des\\ 303\\ 247ription'
861+ repeated_bytes: '\\ u00c1 short des\\ u00e7ription'
861862 repeated_bytes: '\\ x12\\ x34\\ x56\\ x78\\ x90\\ xab\\ xcd\\ xef'
862863 repeated_string: '\\ xd0\\ x9f\\ xd1\\ x80\\ xd0\\ xb8\\ xd0\\ xb2\\ xd0\\ xb5\\ xd1\\ x82'
863864 """
@@ -873,8 +874,9 @@ def testParseUnicode(self, message_module):
873874 self .assertEqual (m .optional_bytes , self ._GOLDEN_BYTES )
874875 self .assertEqual (m .optional_string , self ._GOLDEN_UNICODE )
875876 self .assertEqual (m .repeated_bytes [0 ], self ._GOLDEN_BYTES )
876- # repeated_bytes[1] contained simple \ escaped non-UTF-8 raw binary data.
877- self .assertEqual (m .repeated_bytes [1 ], self ._GOLDEN_BYTES_1 )
877+ self .assertEqual (m .repeated_bytes [1 ], self ._GOLDEN_BYTES )
878+ # repeated_bytes[2] contained simple \ escaped non-UTF-8 raw binary data.
879+ self .assertEqual (m .repeated_bytes [2 ], self ._GOLDEN_BYTES_1 )
878880 # repeated_string[0] contained \ escaped data representing the UTF-8
879881 # representation of _GOLDEN_STR_0 - it needs to decode as such.
880882 self .assertEqual (m .repeated_string [0 ], self ._GOLDEN_STR_0 )
@@ -885,8 +887,9 @@ def testParseBytes(self, message_module):
885887 self .assertEqual (m .optional_bytes , self ._GOLDEN_BYTES )
886888 self .assertEqual (m .optional_string , self ._GOLDEN_UNICODE )
887889 self .assertEqual (m .repeated_bytes [0 ], self ._GOLDEN_BYTES )
890+ self .assertEqual (m .repeated_bytes [1 ], self ._GOLDEN_BYTES )
888891 # repeated_bytes[1] contained simple \ escaped non-UTF-8 raw binary data.
889- self .assertEqual (m .repeated_bytes [1 ], self ._GOLDEN_BYTES_1 )
892+ self .assertEqual (m .repeated_bytes [2 ], self ._GOLDEN_BYTES_1 )
890893 # repeated_string[0] contained \ escaped data representing the UTF-8
891894 # representation of _GOLDEN_STR_0 - it needs to decode as such.
892895 self .assertEqual (m .repeated_string [0 ], self ._GOLDEN_STR_0 )
0 commit comments