init
This commit is contained in:
22
tests/test_korpus.py
Normal file
22
tests/test_korpus.py
Normal file
@@ -0,0 +1,22 @@
|
||||
"""Konsens: 1 kuratierter Wikipedia-Beleg genügt, 1 Blog-Beleg nicht."""
|
||||
from backend import db, korpus
|
||||
from .conftest import topic_anlegen
|
||||
|
||||
|
||||
async def test_wiki_einzelbeleg_bestaetigt():
|
||||
topic = topic_anlegen()
|
||||
run_id = db.insert("runs", topic=topic, status="running")
|
||||
q_wiki = db.insert("quellen", topic=topic, url="https://de.wikipedia.org/w",
|
||||
url_norm="u1", backend="wikipedia_de", status="geladen")
|
||||
q_blog = db.insert("quellen", topic=topic, url="https://blog.de/x",
|
||||
url_norm="u2", backend="ddgs", status="geladen")
|
||||
db.insert("soll", topic=topic, punkt="Overflow-Pomodoros erklären",
|
||||
belege=db.j([{"quelle": q_wiki, "zitat": "z1"}]))
|
||||
db.insert("soll", topic=topic, punkt="Nur Blog-These",
|
||||
belege=db.j([{"quelle": q_blog, "zitat": "z2"}]))
|
||||
await korpus.soll_konsens({"run_id": run_id, "topic": topic, "runde": 1,
|
||||
"item": "r1:konsens", "payload": "{}"})
|
||||
wiki = db.one("SELECT status FROM soll WHERE punkt LIKE 'Overflow%'")
|
||||
blog = db.one("SELECT status FROM soll WHERE punkt LIKE 'Nur Blog%'")
|
||||
assert wiki["status"] == "bestaetigt" # kuratierte Quelle: 1 Beleg reicht
|
||||
assert blog["status"] == "kandidat" # Blog allein bestätigt nicht
|
||||
Reference in New Issue
Block a user