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

Cannot match with callback #727

Open
jcampbell05 opened this issue Jul 8, 2024 · 2 comments
Open

Cannot match with callback #727

jcampbell05 opened this issue Jul 8, 2024 · 2 comments
Labels

Comments

@jcampbell05
Copy link

Describe the bug

When using standard responses you can use the matching behaviour but the callback API doesn't currently allow you to assert any calls to this callback

Additional context

No response

Version of responses

0.25.3

Steps to Reproduce

  1. Register callback
    2.API currently returns None

Expected Result

API returns response we can then use with assert

Actual Result

The api returns none so we can't assert against it

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Jul 8, 2024
@markstory
Copy link
Member

Could you share an example of the code you're trying to make work?

@jcampbell05
Copy link
Author

jcampbell05 commented Jul 9, 2024

resp =   self.responses.add_callback(
                responses.POST,
                'http://example.com',
                callback=fetch_invoice_pdf # Returns {}
 )
assert resp.calls[0].request.body == {}

Currently resp will be None because add_callback returns None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

3 participants