如何编写GRPC python unittest [英] How to write a GRPC python unittest
问题描述
我们将grpc用作所有内部系统的RPC协议.大部分系统是用Java编写的.
We are using grpc as the RPC protocol for all our internal system. Most of the system is written in Java.
在Java中,我们可以使用InprocessServerBuilder进行单元测试.但是,我在Python中找不到类似的类.
In Java, we can use InprocessServerBuilder for unittest. However, I haven't find a similar class in Python.
任何人都可以提供示例代码来说明如何在python中进行GRPC单元测试吗?
Can any one provide a sample code for how to do GRPC unittest in python?
推荐答案
您今天问这个问题有多偶然?我们的单元测试框架刚刚进入代码审查.因此,目前的测试方法是
How serendipitous that you have asked this question today; our unit test framework just entered code review. So for the time being the way to test is to use the full production stack to connect your client-side and server-side code (or to violate the API and mock a lot of internal stuff) but hopefully in days to weeks the much better solution will be available to you.
这篇关于如何编写GRPC python unittest的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!