I've written a Python GRPC client and would like to be able to test it using Pytest. What I would like to do is mock out GRPC server response to be the same response every time. What is the right way to do this?
Asked
Active
Viewed 622 times
2
-
Can you be specific on which libraries you rely on for network calls? Mocking depends on the implementation. – Peter K Sep 28 '22 at 16:24
-
I'm using grpc library. My idea is to mock somehow grpc server response, so I can test client code. – datahack Sep 29 '22 at 08:42
-
Maybe this thread can help you: https://stackoverflow.com/questions/44718078/how-to-write-a-grpc-python-unittest – Peter K Sep 29 '22 at 16:32