mirror of
https://github.com/hoshikawa2/agent_platform_oci.git
synced 2026-07-09 22:04:21 +00:00
First commit
This commit is contained in:
14
tests/unit/test_langgraph_checkpoint_saver.py
Normal file
14
tests/unit/test_langgraph_checkpoint_saver.py
Normal file
@@ -0,0 +1,14 @@
|
||||
import pytest
|
||||
from types import SimpleNamespace
|
||||
from agent_framework.checkpoints.langgraph_saver import RepositoryCheckpointSaver
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_repository_checkpoint_saver_put_get(tmp_path):
|
||||
settings = SimpleNamespace(CHECKPOINT_REPOSITORY_PROVIDER='sqlite', SQLITE_DB_PATH=str(tmp_path/'db.sqlite'))
|
||||
saver = RepositoryCheckpointSaver(settings)
|
||||
config = {'configurable': {'thread_id': 't1'}}
|
||||
next_config = await saver.aput(config, {'id': 'cp1', 'channel_values': {'x': 1}}, {'source': 'test'}, {})
|
||||
assert next_config['configurable']['checkpoint_id'] == 'cp1'
|
||||
tup = await saver.aget_tuple(config)
|
||||
checkpoint = tup.checkpoint if hasattr(tup, 'checkpoint') else tup['checkpoint']
|
||||
assert checkpoint['id'] == 'cp1'
|
||||
Reference in New Issue
Block a user