Name the next release's items without a Touches list, and warn of them in rank_todo.py --check
CI / tests (pull_request) Successful in 4m24s
CI / tests (pull_request) Successful in 4m24s
This commit is contained in:
@@ -2,6 +2,7 @@ import contextlib
|
||||
import dataclasses
|
||||
import os
|
||||
import pathlib
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
@@ -867,6 +868,34 @@ class BesideTest(unittest.TestCase):
|
||||
self.assertEqual(self.said(TODO), [])
|
||||
|
||||
|
||||
class UnpredictedTest(unittest.TestCase):
|
||||
"""The fact that names the next release's items whose details hold no `Touches:` list."""
|
||||
LIST = "\nTouches:\n\n- `src/app.py`: `run`\n"
|
||||
# Item 3's detail ends TODO, so the first list is item 3's.
|
||||
LISTED = TODO + LIST + f"\n### 5. Do it.\n{LIST}\n### 7. Do it.\n{LIST}\n### 8. Do it.\n{LIST}"
|
||||
|
||||
def said(self, todo, *named):
|
||||
return [line for line in rendered(item_facts(todo, plan=planned(todo, CUT, "origin/main", BRANCH, None, *named))).splitlines() if "have no `Touches:` list" in line or "has no `Touches:` list" in line]
|
||||
|
||||
def test_says_nothing_where_every_item_of_the_release_holds_a_list(self):
|
||||
self.assertEqual(self.said(self.LISTED), [])
|
||||
|
||||
def test_names_each_item_without_a_list_where_other_items_of_the_release_wait(self):
|
||||
self.assertEqual(self.said(self.LISTED.replace(f"\n### 7. Do it.\n{self.LIST}", "")), ['- Item 7 of release 0.2.0 has no `Touches:` list. Before the chunk, have one subagent write it, as `~/.claude/CLAUDE.md` → "Working loop" says.'])
|
||||
self.assertEqual(self.said(TODO), ['- Items 5, 3, 7 and 8 of release 0.2.0 have no `Touches:` list. Before the chunk, have one subagent write them, as `~/.claude/CLAUDE.md` → "Working loop" says.'])
|
||||
|
||||
def test_says_nothing_of_an_item_alone_in_its_release(self):
|
||||
alone = "\n".join(line for line in TODO.splitlines() if not re.match(r"\| [578] \|", line)) + "\n"
|
||||
self.assertEqual(self.said(alone), [])
|
||||
|
||||
def test_leaves_alone_a_list_an_edit_of_its_item_made_stale(self):
|
||||
# Item 3's detail names `src/app.py`'s `run`, and its list another file: only a missing list is written.
|
||||
self.assertEqual(self.said(self.LISTED.replace("- `src/app.py`: `run`", "- `src/old.py`", 1)), [])
|
||||
|
||||
def test_says_it_only_to_the_chunk_of_the_plans_next_item(self):
|
||||
# Item 8's chunk starts beside item 3's, whose worker writes the lists: two subagents would write them twice.
|
||||
self.assertEqual(self.said(TODO.replace("| 8 | 0.2.0 | 5 |", "| 8 | 0.2.0 | |"), 8), [])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user