Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#1249] Add headers to outgoing requests logging #539

Merged
merged 7 commits into from
Mar 23, 2023

Conversation

vaszig
Copy link
Contributor

@vaszig vaszig commented Mar 16, 2023

No description provided.

@@ -30,7 +31,7 @@ def install_outgoing_requests_logging():
Session._original_request = Session.request

def new_request(self, *args, **kwargs):
kwargs.setdefault("hooks", {"response": hook_requests_logging})
self.hooks["response"].append(hook_requests_logging)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was changed in case we add more hooks to the session

@codecov-commenter
Copy link

codecov-commenter commented Mar 16, 2023

Codecov Report

Merging #539 (5bc8464) into develop (80f1dcb) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff            @@
##           develop     #539   +/-   ##
========================================
  Coverage    96.47%   96.48%           
========================================
  Files          540      541    +1     
  Lines        19216    19243   +27     
========================================
+ Hits         18539    18566   +27     
  Misses         677      677           
Impacted Files Coverage Δ
src/log_outgoing_requests/admin.py 94.73% <100.00%> (ø)
src/log_outgoing_requests/formatters.py 100.00% <100.00%> (ø)
src/log_outgoing_requests/handlers.py 95.00% <100.00%> (+1.66%) ⬆️
src/log_outgoing_requests/log_requests.py 88.23% <100.00%> (ø)
...ing_requests/migrations/0003_auto_20230321_0724.py 100.00% <100.00%> (ø)
src/log_outgoing_requests/models.py 96.42% <100.00%> (+0.59%) ⬆️
src/log_outgoing_requests/tests/test_logging.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@Bartvaderkin Bartvaderkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm missing a test (modification) for the header saving

And looking at the code I miss test for some other properties? Like the two content-type's and params.

src/log_outgoing_requests/handlers.py Outdated Show resolved Hide resolved
@vaszig vaszig force-pushed the fix/1249-add-headers-to-outgoing-requests-logging branch from a702f21 to 179464a Compare March 21, 2023 08:40
src/log_outgoing_requests/handlers.py Outdated Show resolved Hide resolved
src/log_outgoing_requests/tests/test_logging.py Outdated Show resolved Hide resolved
src/log_outgoing_requests/tests/test_logging.py Outdated Show resolved Hide resolved
src/log_outgoing_requests/tests/test_logging.py Outdated Show resolved Hide resolved
src/log_outgoing_requests/handlers.py Outdated Show resolved Hide resolved
@alextreme alextreme merged commit 462a316 into develop Mar 23, 2023
@alextreme alextreme deleted the fix/1249-add-headers-to-outgoing-requests-logging branch March 23, 2023 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants