Test that the prompt and the refusal name the team's labels
CI / tests (pull_request) Successful in 4m2s

This commit is contained in:
Lilleman
2026-11-19 17:21:20 +01:00
parent ff3961ca77
commit f8cabf78bf
2 changed files with 10 additions and 0 deletions
+2
View File
@@ -91,6 +91,8 @@ class FilingAFinding(FindingsTest):
self.assertEqual((code, out, filed.labels), (0, f"Filed {filed.key} in the epic ABC-12.\n", ("twu-4",)))
code, _, err, _ = self.run_with(["ABC-12", "--file", "Retry", "--label", "twu-4", "--label", "repo:api"])
self.assertEqual((code, err), (1, "cannot file the finding in the epic ABC-12: twu-4 and repo:api each say who works it; write one of them\n"))
_, _, err, _ = self.run_with(["ABC-12", "--file", "Retry", "--label", "twu"])
self.assertTrue(err.endswith("or `do-epic-human` for a task of the human's (or the team's `twu-4`)\n"), err)
def test_a_release_review_takes_its_label_beside_its_repo(self) -> None:
code, out, _, _ = self.run_with(["ABC-12", "--file", "Review api", "--label", "repo:api", "--label", "do-epic-release-review"])
+8
View File
@@ -162,6 +162,14 @@ class Planning(DoEpicTest):
args = fake.made("claude")[0][0]
self.assertEqual(args[args.index("--add-dir") + 1], str(checkout))
def test_asks_for_one_of_the_teams_labels_too_and_takes_it(self) -> None:
with (self.home / ".claude-projects/do-epic/config.toml").open("a", encoding="utf-8") as config:
config.write('\n[label-repos]\nbackend = "api"\n')
self.issues = [issue("ABC-20")]
fake = FakeEffects(claude=[says({"parts": []}), says({"pick": "unclear", "question": "Is the importer in api or in web?"})], inputs=["backend"])
found, _, _ = self.plan(fake)
self.assertEqual((found, fake.made("input")), ([issue("ABC-20", "repo:api")], ["The label that says where ABC-20 is worked, `repo:<name>`, `do-epic-claude` or `do-epic-human` (or the team's `backend`), or Enter alone to leave it waiting: "]))
def test_asks_the_human_for_the_label_of_an_issue_the_rule_leaves_unclear_until_one_is_typed(self) -> None:
self.issues = [issue("ABC-20")]
fake = FakeEffects(claude=[says({"parts": []}), says({"pick": "unclear", "question": "Is the importer in api or in web?"})], inputs=["api", "a b", " repo:web "])