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

test: duplicate function for get_user_function #242

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions azure/functions/decorators/function_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,16 @@ def get_dict_repr(self) -> Dict:

def get_user_function(self) -> Callable[..., Any]:
"""Get the python function customer defined.
This is used externally by customers for unit testing.

:return: The python function customer defined.
"""
return self._func

def _get_function(self) -> Callable[..., Any]:
"""Get the python function customer defined.
This is used internally by the worker when indexing
the function.

:return: The python function customer defined.
"""
Expand Down
1 change: 1 addition & 0 deletions tests/decorators/test_function_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def dummy():

def test_function_creation(self):
self.assertEqual(self.func.get_user_function(), self.dummy)
self.assertEqual(self.func._get_function(), self.dummy)
self.assertEqual(self.func.function_script_file, "dummy.py")

def test_add_trigger(self):
Expand Down