jeudi 1 septembre 2016

How to test RPC of SOAP web services?

I am currently learning building a SOAP web services with django and spyne. I have successfully tested my model using unit test. However, when I tried to test all those @rpc functions, I have no luck there at all.

What I have tried in testing those @rpc functions: 1. Get dummy data in model database 2. Start a server at localhost:8000 3. Create a suds.Client object that can communicate with localhost:8000 4. Try to invoke @rpc functions from the suds.Client object, and test if the output matches what I expected.

However, when I run the test, I believe the test got blocked by the running server at localhost:8000 thus no test code can be run while the server is running.

I tried to make the server run on a different thread, but that messed up my test even more.

I have searched as much as I could online and found no materials that can answer this question.

TL;DR: how do you test @rpc functions using unit test?

Aucun commentaire:

Enregistrer un commentaire