Exemple #1
0
 async def main(cowsay: str = aiodine.depends(cowsay)) -> str:
     await io()
     return cowsay
Exemple #2
0
 async def cowsay(message: str = aiodine.depends(moo)) -> typing.AsyncIterator[str]:
     await io()
     yield f"Cow says: {message}"
     await io()
     await event.set()
Exemple #3
0
 async def cowsay(message: str = aiodine.depends(moo)) -> str:
     await io()
     return f"Cow says: {message}"
 async def say(who: str, what: str = aiodine.depends(Moo)) -> str:
     await io()
     if should_raise:
         raise ValueError
     return f"{who} says {what}"
 async def say(who: str, what: str = aiodine.depends(moo)) -> str:  # type: ignore
     await io()
     return f"{who} says {what}"
Exemple #6
0
 async def main(db: Database = aiodine.depends(get_db)) -> None:
     rows = await db.fetchall()
     print("Rows:", rows)
Exemple #7
0
 async def cowsay(what: str = aiodine.depends(moo)) -> None:
     print(f"Going to say {what!r}...")
     print(f"Cow says {what}")
Exemple #8
0
def test_dependable_repr(func: typing.Callable, output: str) -> None:
    dependable = aiodine.depends(func)
    assert repr(dependable) == output