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

feat(testing): add msgpack support #2394

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

arthurprioli
Copy link

@arthurprioli arthurprioli commented Oct 28, 2024

Summary of Changes

Added the msgpack parameter in simulate_request, working in a similar way than the JSON one, when msgpack is not None we pass the content type as MEDIA_MSGPACK and it is fully documented on the comments and documentation.

Related Issues

Fixes #1026.
Relates to #333.

Pull Request Checklist

This is just a reminder about the most common mistakes. Please make sure that you tick all appropriate boxes. But please read our contribution guide at least once; it will save you a few review cycles!

If an item doesn't apply to your pull request, check it anyway to make it apparent that there's nothing to do.

  • Applied changes to both WSGI and ASGI code paths and interfaces (where applicable).
  • Added tests for changed code.
    Added tests in tests/test_testing.py.
  • Prefixed code comments with GitHub nick and an appropriate prefix.
    Didn't understand where to put the prefix with my GitHub nick.
  • Coding style is consistent with the rest of the framework.
  • Updated documentation for changed code.
    • Added docstrings for any new classes, functions, or modules.
    • Updated docstrings for any modifications to existing code.
    • Updated both WSGI and ASGI docs (where applicable).
    • Added references to new classes, functions, or modules to the relevant RST file under docs/.
    • Updated all relevant supporting documentation files under docs/.
    • A copyright notice is included at the top of any new modules (using your own name or the name of your organization).
    • Changed/added classes/methods/functions have appropriate versionadded, versionchanged, or deprecated directives.
      Didn't understand where to put the versionchanged prefix and if I should put it.
    • Changes (and possible deprecations) have towncrier news fragments under docs/_newsfragments/, with the file name format {issue_number}.{fragment_type}.rst. (Run towncrier --draft to ensure it renders correctly.)

If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!

PR template inspired by the attrs project.

@arthurprioli arthurprioli marked this pull request as draft October 29, 2024 12:54
Copy link

codecov bot commented Oct 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (ead6535) to head (8fdf4aa).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2394   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           64        64           
  Lines         7728      7734    +6     
  Branches      1071      1072    +1     
=========================================
+ Hits          7728      7734    +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@CaselIT CaselIT left a comment

Choose a reason for hiding this comment

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

looks mostly fine, thanks!

The only comment that needs to be solved is the docstirng one

falcon/testing/client.py Outdated Show resolved Hide resolved
tests/test_testing.py Outdated Show resolved Hide resolved
@arthurprioli arthurprioli requested a review from CaselIT October 30, 2024 20:27
@vytas7 vytas7 changed the title 1026 add messsagepack support feat(testing): add msgpack support Nov 4, 2024
@arthurprioli arthurprioli marked this pull request as ready for review November 10, 2024 12:17
docs/changes/4.1.0.rst Outdated Show resolved Hide resolved
@vytas7 vytas7 marked this pull request as draft November 10, 2024 19:19
@vytas7 vytas7 marked this pull request as ready for review November 10, 2024 19:19
@vytas7 vytas7 marked this pull request as draft November 10, 2024 19:19
Copy link
Member

@vytas7 vytas7 left a comment

Choose a reason for hiding this comment

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

Hi again, and thanks for this pull request!
I think it is a great start, but it still needs work to bring it out from Draft (that I've just converted it to), and later to merge it.

(See the inline comments.)

falcon/testing/client.py Outdated Show resolved Hide resolved
tests/test_testing.py Show resolved Hide resolved
docs/changes/4.1.0.rst Outdated Show resolved Hide resolved
falcon/testing/client.py Show resolved Hide resolved
tests/test_testing.py Show resolved Hide resolved
docs/changes/4.1.0.rst Outdated Show resolved Hide resolved
tests/test_testing.py Show resolved Hide resolved
@vytas7
Copy link
Member

vytas7 commented Dec 30, 2024

@arthurprioli thanks for your work on this so far.
Unfortunately, this PR still has much work left (see the inline comments) in order to bring it to the point where we can merge it. Do you intend to continue work, or can we close it for the time being? We are trying to get our PR backlog under control.

@arthurprioli
Copy link
Author

Hello @vytas7, sorry for taking too long to answer. But can I still work on this PR? I had a bit of a messy end of year and didn’t have much time to finish it, but now I have more free time so I could wrap it up.

@vytas7
Copy link
Member

vytas7 commented Dec 30, 2024

Yes @arthurprioli, no worries, you can still work on it 🙂

@arthurprioli arthurprioli requested a review from vytas7 January 8, 2025 19:08
@arthurprioli arthurprioli marked this pull request as ready for review January 9, 2025 19:20
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.

Add MessagePack support to the test client
3 participants