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.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
"""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()
|
||||
Reference in New Issue
Block a user