9378fe0427
A deliberately small Python service — auth helpers, a sqlite-backed store, and two request handlers — plus a .pr-review.json that steers the reviewer toward this repo's house rules. Pull requests against it carry planted defects so the reviewer has something real to find.
22 lines
491 B
Python
22 lines
491 B
Python
import os
|
|
import sys
|
|
|
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
|
|
|
from app.store import Store # noqa: E402
|
|
|
|
|
|
def test_add_and_get_note():
|
|
s = Store()
|
|
nid = s.add_note("alice", "hello", "world")
|
|
note = s.get_note(nid)
|
|
assert note[1] == "alice"
|
|
assert note[2] == "hello"
|
|
|
|
|
|
def test_notes_are_scoped_to_owner():
|
|
s = Store()
|
|
s.add_note("alice", "a", "1")
|
|
s.add_note("bob", "b", "2")
|
|
assert len(s.notes_for("alice")) == 1
|