Protocol Buffers - Google's data interchange format (grpc依赖) https://developers.google.com/protocol-buffers/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

14 lines
385 B

import upb
import unittest
class TestFieldDef(unittest.TestCase):
def test_construction(self):
fielddef1 = upb.FieldDef()
self.assertTrue(fielddef1 is not None)
fielddef2 = upb.FieldDef(number=1, name="field1", label=2, type=3)
self.assertTrue(fielddef2 is not None)
self.assertTrue(id(fielddef1) != id(fielddef2))
if __name__ == '__main__':
unittest.main()