Azure / msrest-for-python

The runtime library "msrest" for AutoRest generated Python clients.
MIT License
41 stars 64 forks source link

Add requests hooks #31

Closed lmazuel closed 7 years ago

lmazuel commented 7 years ago

This adds a new parameter in configuration "user_hooks" that can be a response requests hook.

Note that we inject the current sessions inside this hook using the kwargs of the callback. I don't expect any conflict since the key is "msrest" and that's not a requests parameter.

@brettcannon to confirm you're not shocked

FYI @yugangw-msft this is step 1 of "automatic provider registration"

codecov-io commented 7 years ago

Codecov Report

Merging #31 into master will decrease coverage by 0.35%. The diff coverage is 37.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #31      +/-   ##
==========================================
- Coverage   88.22%   87.87%   -0.36%     
==========================================
  Files          10       10              
  Lines        1138     1146       +8     
==========================================
+ Hits         1004     1007       +3     
- Misses        134      139       +5
Impacted Files Coverage Δ
msrest/configuration.py 38.02% <100%> (+0.88%) :arrow_up:
msrest/service_client.py 92.85% <28.57%> (-2.8%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update db9934f...fe8a2e9. Read the comment docs.