Files
stork/tests/test_store.py
T
ilia b91ba3490c
CI / secret-scan (pull_request) Successful in 32s
CI / python-ci (pull_request) Successful in 50s
Add shareable multi-board links with paper UI and voice notes.
Boards use /b/<uid> with no invite password; restore renamable columns,
recordings, and seeded locale notes, with first column locked.
2026-08-07 14:47:28 -04:00

22 lines
770 B
Python

"""Unit tests for Store ranking helpers."""
from __future__ import annotations
from pathlib import Path
from stork.db import Store
def test_store_ranks_by_score_then_alpha(tmp_path: Path) -> None:
store = Store(tmp_path / "t.sqlite3", bootstrap_invite="unit-invite")
board_id = store.list_boards()[0]["id"]
a = store.add_name(board_id, "c1", "Zed", "x")
store.add_name(board_id, "c1", "Ann", "x")
c = store.add_name(board_id, "c1", "Bo", "x")
store.vote(a["id"], "v1", "A", 1, board_id=board_id)
store.vote(c["id"], "v1", "A", 1, board_id=board_id)
store.vote(c["id"], "v2", "B", 1, board_id=board_id)
ranked = store.list_names(board_id, "c1")
assert [n["spelling"] for n in ranked] == ["Bo", "Zed", "Ann"]
store.close()