I am writing unit-test code with pytest for my python functions.
Those functions work with requests module that allows us to easily talk to the web servers.
The thing is that the web server to which the functions communicate don'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 this kind of function of code?
Edit : added test code
def test_get_data():
assert Info(None, None, None).get_data("Tommy drill") == (
"id" : "KRG552100411"
)
I want to do test like above. Tommy drill is just one of items in the shop. But the thing is sometimes, the item disappears from the list. So test returns f