Fix typing and minor issues
This commit is contained in:
parent
2db2253578
commit
72ab627a34
54 changed files with 635 additions and 589 deletions
22
tests/test_great_ai.py
Normal file
22
tests/test_great_ai.py
Normal 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]
|
||||
Loading…
Add table
Add a link
Reference in a new issue