Skip to content

Commit 1426076

Browse files
author
Victoria Hall
committed
duplicate function for get_user_function
1 parent 2e5ea4f commit 1426076

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

azure/functions/decorators/function_app.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,16 @@ def get_dict_repr(self) -> Dict:
209209

210210
def get_user_function(self) -> Callable[..., Any]:
211211
"""Get the python function customer defined.
212+
This is used externally by customers for unit testing.
213+
214+
:return: The python function customer defined.
215+
"""
216+
return self._func
217+
218+
def _get_function(self) -> Callable[..., Any]:
219+
"""Get the python function customer defined.
220+
This is used internally by the worker when indexing
221+
the function.
212222
213223
:return: The python function customer defined.
214224
"""

tests/decorators/test_function_app.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def dummy():
3636

3737
def test_function_creation(self):
3838
self.assertEqual(self.func.get_user_function(), self.dummy)
39+
self.assertEqual(self.func._get_function(), self.dummy)
3940
self.assertEqual(self.func.function_script_file, "dummy.py")
4041

4142
def test_add_trigger(self):

0 commit comments

Comments
 (0)