Fix typing and minor issues

This commit is contained in:
Andras Schmelczer 2022-07-07 14:12:44 +02:00
parent 2db2253578
commit 72ab627a34
54 changed files with 635 additions and 589 deletions

22
tests/test_great_ai.py Normal file
View file

@ -0,0 +1,22 @@
from asyncio import sleep
import pytest
from great_ai import GreatAI
def test_process_batch() -> None:
@GreatAI.create
def f(x: int) -> int:
return x + 2
assert [v.output for v in f.process_batch([3, 9, 34])] == [5, 11, 36]
@pytest.mark.asyncio
async def test_process_batch_async() -> None:
@GreatAI.create
async def f(x: int) -> int:
await sleep(0.2)
return x + 2
assert [v.output for v in f.process_batch([3, 9, 34])] == [5, 11, 36]