Mock a series of interdependent calls
I have a method that scrapes a web page and saves data into a file (see below for an example code). I need to test that the resulting data is well-formed. The problem is, the data is received from a series of calls, and further calls use the results of previous ones. What is worse, many of the calls involved are done on the same objects (a Webdriver , a WebDriverWait and the expected_conditions module), with different arguments. I see that unittest.mock.Mock can mock the result of a simple call, or a series of simple calls, but can't see how to implement something entangled like this. The only