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

Allow access to body set by synthetic in tests #382

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

gabrielg
Copy link
Contributor

@gabrielg gabrielg commented Nov 4, 2024

It's useful to be able to access the body as set by calls to synthetic and synthetic.base64 in tests, e.g. for asserting that error handling code generates expected responses. This exposes the body via a new variable, testing.synthetic_body. There's some mild tomfoolery to be able to rewind the response body after it's read, but nothing too egregious.

Thanks again for Falco!

It's useful to be able to access the body as set by calls to `synthetic`
and `synthetic.base64` in tests, e.g. for asserting that error handling
code generates expected responses. This exposes the body via a new
variable, `testing.synthetic_body`.
Copy link
Owner

@ysugimoto ysugimoto left a comment

Choose a reason for hiding this comment

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

Great Idea!
Thanks for your several PRs, these are all gread improvements for falco 👍

@ysugimoto ysugimoto merged commit 2e1cb44 into ysugimoto:main Jan 28, 2025
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.

2 participants