aboutsummaryrefslogtreecommitdiff
path: root/.ai/scripts/tests/test_drill_deck_stats.py
diff options
context:
space:
mode:
Diffstat (limited to '.ai/scripts/tests/test_drill_deck_stats.py')
-rw-r--r--.ai/scripts/tests/test_drill_deck_stats.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/.ai/scripts/tests/test_drill_deck_stats.py b/.ai/scripts/tests/test_drill_deck_stats.py
index 02d9c4e..3154d42 100644
--- a/.ai/scripts/tests/test_drill_deck_stats.py
+++ b/.ai/scripts/tests/test_drill_deck_stats.py
@@ -94,3 +94,41 @@ def test_cli_dirty_deck_warns_and_exits_one(tmp_path):
def test_cli_missing_file_exits_two(tmp_path):
r = _run(tmp_path / "nope.org")
assert r.returncode == 2
+
+
+NO_TITLE_DECK = """* Section
+** What is DeepSat? :drill:
+:PROPERTIES:
+:ID: card-1
+:END:
+A satellite company.
+"""
+
+# Two cards, only one PROPERTIES drawer.
+PROP_MISMATCH_DECK = """#+TITLE: DeepSat Flashcards
+
+* Section
+** What is DeepSat? :drill:
+A satellite company.
+** Who founded it? :drill:
+:PROPERTIES:
+:ID: card-2
+:END:
+The team.
+"""
+
+
+def test_cli_missing_title_warns_and_exits_one(tmp_path):
+ f = tmp_path / "notitle.org"
+ f.write_text(NO_TITLE_DECK)
+ r = _run(f)
+ assert r.returncode == 1
+ assert "no #+TITLE" in r.stdout
+
+
+def test_cli_properties_count_mismatch_warns_and_exits_one(tmp_path):
+ f = tmp_path / "mismatch.org"
+ f.write_text(PROP_MISMATCH_DECK)
+ r = _run(f)
+ assert r.returncode == 1
+ assert "does not match card count" in r.stdout