Use lower_with_under for Python nextgen tests

PiperOrigin-RevId: 635661121
pull/16880/head
Jie Luo 10 months ago committed by Copybara-Service
parent e2bc285b5e
commit 696b5a3554
  1. 7
      python/google/protobuf/internal/proto_json_test.py
  2. 3
      python/google/protobuf/internal/proto_test.py

@ -16,18 +16,19 @@ from google.protobuf.util import json_format_proto3_pb2
class ProtoJsonTest(unittest.TestCase):
def testSimpleSerialize(self):
def test_simple_serialize(self):
message = json_format_proto3_pb2.TestMessage()
message.int32_value = 12345
expected = {'int32Value': 12345}
self.assertEqual(expected, proto_json.serialize(message))
def testSimpleParse(self):
def test_simple_parse(self):
expected = 12345
js_dict = {'int32Value': expected}
message = proto_json.parse(json_format_proto3_pb2.TestMessage,
js_dict)
self.assertEqual(expected, message.int32_value)
self.assertEqual(expected, message.int32_value) # pytype: disable=attribute-error
if __name__ == "__main__":
unittest.main()

@ -23,12 +23,13 @@ from google.protobuf import unittest_proto3_arena_pb2
@testing_refleaks.TestCase
class ProtoTest(unittest.TestCase):
def testSerializeParse(self, message_module):
def test_simple_serialize_parse(self, message_module):
msg = message_module.TestAllTypes()
test_util.SetAllFields(msg)
serialized_data = proto.serialize(msg)
parsed_msg = proto.parse(message_module.TestAllTypes, serialized_data)
self.assertEqual(msg, parsed_msg)
if __name__ == '__main__':
unittest.main()

Loading…
Cancel
Save