mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-16 17:55:26 -04:00
test: move area_cli tests into cli directory (#3842)
* test: move area_cli tests into cli directory * test: include research CLI status in cli test move
This commit is contained in:
committed by
GitHub
parent
3e65326c3f
commit
a79c0bd369
@@ -0,0 +1,39 @@
|
||||
from types import SimpleNamespace
|
||||
|
||||
from tests.helpers.cli_loader import load_script
|
||||
from tests.helpers.db_stubs import make_core_db_stub
|
||||
|
||||
|
||||
def _load_sessions_cli(monkeypatch):
|
||||
make_core_db_stub(
|
||||
monkeypatch,
|
||||
attributes={"SessionLocal": object, "Session": object},
|
||||
install_core_package=True,
|
||||
)
|
||||
return load_script("odysseus-sessions")
|
||||
|
||||
|
||||
def test_serialize_normalizes_numeric_counters(monkeypatch):
|
||||
cli = _load_sessions_cli(monkeypatch)
|
||||
session = SimpleNamespace(
|
||||
id="s1",
|
||||
name="chat",
|
||||
model="m",
|
||||
endpoint_url="",
|
||||
owner=None,
|
||||
folder=None,
|
||||
archived=False,
|
||||
rag=False,
|
||||
is_important=False,
|
||||
message_count="12",
|
||||
total_input_tokens="bad",
|
||||
total_output_tokens=None,
|
||||
last_accessed=None,
|
||||
created_at=None,
|
||||
)
|
||||
|
||||
out = cli._serialize(session)
|
||||
|
||||
assert out["message_count"] == 12
|
||||
assert out["total_input_tokens"] == 0
|
||||
assert out["total_output_tokens"] == 0
|
||||
Reference in New Issue
Block a user