Esempio n. 1
0
 async def main(cowsay: str = aiodine.depends(cowsay)) -> str:
     await io()
     return cowsay
Esempio n. 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()
Esempio n. 3
0
 async def cowsay(message: str = aiodine.depends(moo)) -> str:
     await io()
     return f"Cow says: {message}"
Esempio n. 4
0
 async def say(who: str, what: str = aiodine.depends(Moo)) -> str:
     await io()
     if should_raise:
         raise ValueError
     return f"{who} says {what}"
Esempio n. 5
0
 async def say(who: str, what: str = aiodine.depends(moo)) -> str:  # type: ignore
     await io()
     return f"{who} says {what}"
Esempio n. 6
0
 async def main(db: Database = aiodine.depends(get_db)) -> None:
     rows = await db.fetchall()
     print("Rows:", rows)
Esempio n. 7
0
 async def cowsay(what: str = aiodine.depends(moo)) -> None:
     print(f"Going to say {what!r}...")
     print(f"Cow says {what}")
Esempio n. 8
0
def test_dependable_repr(func: typing.Callable, output: str) -> None:
    dependable = aiodine.depends(func)
    assert repr(dependable) == output