From 1204071e52b8935977ed85a82ed1ac9dc15d7fde Mon Sep 17 00:00:00 2001 From: Achille Roussel Date: Fri, 14 Jun 2024 14:12:20 -0700 Subject: [PATCH] enable nested function call test Signed-off-by: Achille Roussel --- src/dispatch/test/__init__.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/dispatch/test/__init__.py b/src/dispatch/test/__init__.py index 9b21831..ef11729 100644 --- a/src/dispatch/test/__init__.py +++ b/src/dispatch/test/__init__.py @@ -347,6 +347,11 @@ def echo(name: str) -> str: return name +@_registry.function +async def echo2(name: str) -> str: + return await echo(name) + + @_registry.function def length(name: str) -> int: return len(name) @@ -488,17 +493,9 @@ async def test_call_two_functions(self): # where we register each function once in the globla scope, so no cells need # to be created. - # @aiotest - # async def test_call_nested_function_with_result(self): - # @self.dispatch.function - # def echo(name: str) -> str: - # return name - - # @self.dispatch.function - # async def echo2(name: str) -> str: - # return await echo(name) - - # self.assertEqual(await echo2("hello"), "hello") + @aiotest + async def test_call_nested_function_with_result(self): + self.assertEqual(await echo2("hello"), "hello") # @aiotest # async def test_call_nested_function_with_error(self):