4b86b2a660
- server-dev start/stop/deploy 및 Gitea push 자동 배포 - local-dev 로컬 개발 환경 Co-authored-by: Cursor <cursoragent@cursor.com>
41 lines
1.1 KiB
Python
41 lines
1.1 KiB
Python
"""Functional tests for AgentPendingStore (in-memory path)."""
|
|
|
|
from agent.pending_store import AgentPendingStore
|
|
|
|
|
|
def test_pending_save_get_clear_memory_fallback(monkeypatch):
|
|
monkeypatch.setattr(AgentPendingStore, "_init_mongo", lambda self: None)
|
|
|
|
store = AgentPendingStore()
|
|
store.save(
|
|
"user-a",
|
|
pending_intent_type="FARE_SEARCH",
|
|
pending_params={"toIc": "신갈"},
|
|
missing_params=["fromIc"],
|
|
)
|
|
|
|
loaded = store.get("user-a")
|
|
assert loaded is not None
|
|
assert loaded["pendingIntentType"] == "FARE_SEARCH"
|
|
assert loaded["pendingParams"]["toIc"] == "신갈"
|
|
assert loaded["missingParams"] == ["fromIc"]
|
|
|
|
store.clear("user-a")
|
|
assert store.get("user-a") is None
|
|
|
|
|
|
def test_pending_normalizes_anonymous_bot_id(monkeypatch):
|
|
monkeypatch.setattr(AgentPendingStore, "_init_mongo", lambda self: None)
|
|
|
|
store = AgentPendingStore()
|
|
store.save(
|
|
None,
|
|
pending_intent_type="FARE_UNPAID",
|
|
pending_params={},
|
|
missing_params=["carNo"],
|
|
)
|
|
|
|
loaded = store.get("")
|
|
assert loaded is not None
|
|
assert loaded["pendingIntentType"] == "FARE_UNPAID"
|