Files
stork/tests/test_store.py
T
ilia b88791a0b7
CI / python-ci (push) Successful in 1m39s
CI / secret-scan (push) Successful in 32s
Add Stork family name board MVP with invite auth and votes.
Includes multilingual etymology fields, seed data for starter names, and CI-ready Python project layout.
2026-08-06 16:43:06 -04:00

21 lines
609 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")
a = store.add_name("first", "Zed", "x")
store.add_name("first", "Ann", "x")
c = store.add_name("first", "Bo", "x")
store.vote(a["id"], "v1", "A", 1)
store.vote(c["id"], "v1", "A", 1)
store.vote(c["id"], "v2", "B", 1)
ranked = store.list_names("first")
assert [n["spelling"] for n in ranked] == ["Bo", "Zed", "Ann"]
store.close()