Closed kura closed 10 years ago
Seems this was me being stupid...
@kura Hi Kura, Ive been having the same problem. Could you please explain what you originally did wrong or overlooked?
@victorevector this was over 6 months ago but, I believe it may had had something to do with the fact that I was defining the URL to mock a response for as https://api.digitalocean.com/v2/kura
but the URL my client code actually requested was https://api.digitalocean.com/v2/kura/
.
I believe my client code may have been appending the trailing slash, causing the mocked URL to be different.
I have a class that sets up and handles HTTP requests for me
Which is called similar to this
When I try to use this from within a TestCase via nosetests I get a 404 error from requests and it actually does the HTTP request to get that error, instead of using the mocked content from responses.
This is the final HTTPError exception that is triggered.
As you can see, this is actually sending the request off to the server, rather than serving up the mocked response.