11
11
from absl .testing import absltest
12
12
from absl .testing import parameterized
13
13
14
+ from google .protobuf import unknown_fields
14
15
from google .protobuf .internal import api_implementation
15
16
from pybind11_protobuf .tests import extension_in_other_file_in_deps_pb2
16
17
from pybind11_protobuf .tests import extension_in_other_file_pb2
@@ -179,8 +180,8 @@ def test_reserialize_allow_unknown_inner(self):
179
180
a = get_allow_unknown_inner (96 )
180
181
b = m .reserialize_allow_unknown_inner (a )
181
182
if api_implementation .Type () == 'cpp' :
182
- self .assertLen (b . UnknownFields ( ), 1 )
183
- self .assertEqual (2001 , b . UnknownFields ( )[0 ].field_number )
183
+ self .assertLen (unknown_fields . UnknownFieldSet ( b ), 1 )
184
+ self .assertEqual (2001 , unknown_fields . UnknownFieldSet ( b )[0 ].field_number )
184
185
else :
185
186
b_value = b .Extensions [
186
187
extension_in_other_file_pb2 .AllowUnknownInnerExtension .hook ].value
@@ -190,8 +191,9 @@ def test_reserialize_allow_unknown_outer(self):
190
191
a = extension_pb2 .AllowUnknownOuter (inner = get_allow_unknown_inner (97 ))
191
192
b = m .reserialize_allow_unknown_outer (a )
192
193
if api_implementation .Type () == 'cpp' :
193
- self .assertLen (b .inner .UnknownFields (), 1 )
194
- self .assertEqual (2001 , b .inner .UnknownFields ()[0 ].field_number )
194
+ self .assertLen (unknown_fields .UnknownFieldSet (b .inner ), 1 )
195
+ self .assertEqual (
196
+ 2001 , unknown_fields .UnknownFieldSet (b .inner )[0 ].field_number )
195
197
else :
196
198
b_inner_value = b .inner .Extensions [
197
199
extension_in_other_file_pb2 .AllowUnknownInnerExtension .hook ].value
0 commit comments