descriptor_pool_test.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:Vector-Tiles-Reader-QGIS-Plugin 作者: geometalab 项目源码 文件源码
def testEmptyDescriptorPool(self):
    # Check that an empty DescriptorPool() contains no messages.
    pool = descriptor_pool.DescriptorPool()
    proto_file_name = descriptor_pb2.DESCRIPTOR.name
    self.assertRaises(KeyError, pool.FindFileByName, proto_file_name)
    # Add the above file to the pool
    file_descriptor = descriptor_pb2.FileDescriptorProto()
    descriptor_pb2.DESCRIPTOR.CopyToProto(file_descriptor)
    pool.Add(file_descriptor)
    # Now it exists.
    self.assertTrue(pool.FindFileByName(proto_file_name))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号