I have some code that I would like to test, it is a fairly vanilla GET request wrapper, but the implementation of it requests data from the API multip ...
I have some code that I would like to test, it is a fairly vanilla GET request wrapper, but the implementation of it requests data from the API multip ...
I am learning to use mock tests for my FastAPI endpoints. And I am puzzled by this very basic question: how does mock test actually test an API respon ...
I am creating my own fixture to simulate a service endpoint needed in my unit tests. In order to intercept the HTTP requests, I use requests_mock as f ...
How to check if a request mocked by requests_mock added some query parameters to a URL? I have a function func thats do a HTTP POST on the url with s ...
I am trying to mock a simple POST request that creates a resource from the request body, and returns the resource that was created. For simplicity, le ...
I found that requests_mock used as a fixture with pytest applies to all requests even if they are not set. I'm not sure if it's a requests_mock/pytes ...
I know I can easily use requests-mock to get calls/custom sessions calls quickly. Now I have a custom authenticator: class SimpsonsAuth(requests.aut ...
I have a method which is calling two different end points and validating there response. I want to mock the both the url in pytest like this: It ...
I am using python requests to to access some apis, recently I learned requests_mock for mocking http responses for testing. The responses from api tha ...
What I've Done I've written an authentication class for obtaining an application's bearer token from Twitter using the application's API Key and its ...
I am mocking a get request in my unittest code using requests-mock, but when I run the code during testing, it still tries to hit the actual URL inste ...
I'm currently trying to do unit tests using the requests_mock library in order to patch requests. I've written the following code: But I am getting ...
I'm using requests_mock in my unit tests and would like to mock response.elapsed attribute but have't found proper way to do it. Just found a workarou ...
I'm creating a unit test making sure my http client is passing auth token correctly. I'm using requests_mock lib But history._request is a protecte ...
My function that I am trying to test is returning list of strings: My test function: I am getting error like: json.decoder.JSONDecodeError or st ...
I am using requests-mock and I am trying to figure out how to assert that the put request has been called correctly: def funtion_to_be_tested(): ...
I'm making an HTTP GET request using the requests library. For example (truncated): requests.get("http://123-fake-api.com") I've written a test fol ...
I'm using requests-mock to mock an external service with a dynamic response. The service's URL is something like http://test/containers/test/1234, wh ...