Skip to content

Commit 5d58d0e

Browse files
committed
clean up
1 parent b2a110d commit 5d58d0e

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/test_embedding_async.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from unittest.mock import MagicMock
2+
import unittest
3+
from jigsawstack.exceptions import JigsawStackError
4+
from jigsawstack import AsyncJigsawStack
5+
import pytest
6+
import asyncio
7+
import logging
8+
9+
logging.basicConfig(level=logging.INFO)
10+
logger = logging.getLogger(__name__)
11+
12+
13+
def test_async_embedding_generation_response():
14+
async def _test():
15+
client = AsyncJigsawStack()
16+
try:
17+
result = await client.embedding({"text": "Hello, World!", "type": "text"})
18+
logger.info(result)
19+
assert result["success"] == True
20+
except JigsawStackError as e:
21+
pytest.fail(f"Unexpected JigsawStackError: {e}")
22+
23+
asyncio.run(_test())

0 commit comments

Comments
 (0)