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

Provide a fake HttpRequest class for testing #262

Closed
brettcannon opened this issue Dec 10, 2018 · 2 comments
Closed

Provide a fake HttpRequest class for testing #262

brettcannon opened this issue Dec 10, 2018 · 2 comments
Assignees

Comments

@brettcannon
Copy link
Member

If you want to unit test your function, you need to be able to provide a fake HttpRequest object. Unfortunately the azure.functions._abc.HttpRequest has 7 methods/attribute to override. You can use azure.function_workers.bindings.http.HttpRequest, but its __init__() wants some undocumented details (e.g. meta.TypedDataKind), and it also wants everything specified when some sensible defaults for testing would go a long way.

@asavaritayal
Copy link
Contributor

@elprans do you have an update on this?

@elprans
Copy link
Collaborator

elprans commented Jan 9, 2019

@asavaritayal I'm working on a PR

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

No branches or pull requests

4 participants