Skip to content

Commit

Permalink
enable nested function call test
Browse files Browse the repository at this point in the history
Signed-off-by: Achille Roussel <[email protected]>
  • Loading branch information
achille-roussel committed Jun 14, 2024
1 parent f13e242 commit 1204071
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/dispatch/test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 1204071

Please sign in to comment.