mardi 25 mai 2021

how to write a test code for functions which connect to web

I am writing test code with pytest for functions. Those functions work with requests module that allows us easy to talk to web servers. The thing is the web server the functions communicate doesn't return same value. for example, the functions communicate to www.toolmarket.com to ask how much Tommy drill is. But sometimes, Tommy drill is not in the list of the web shop. In this case, My test code returns f. How can I write test code for kind of this functions of code?




Aucun commentaire:

Enregistrer un commentaire