Closed ketan96-m closed 3 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Please upload report for BASE (
fix_timeouts@66a1dca
). Learn more about missing BASE report.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
In light of using the new Aiohttp module for making async get and post requests, the typical httpx.Response was not working. Since we were dealing with double context managers e.g
Found a way to patch the get request Decorate the test functions with
@patch("servicex.servicex_adapter.RetryClient.get")
Mock response and status
Resources: https://stackoverflow.com/questions/28850070/python-mocking-a-context-manager https://blog.sneawo.com/blog/2019/05/22/mock-aiohttp-request-in-unittests/
Optimizations:
Any help in compressing the 2 lines into one so that we can pass the response(with json and status code) directly to the get.return_value Typical httpx.Response() doesn't work