Kill the surviving mutants of the repo pick
CI / tests (pull_request) Failing after 3m43s

This commit is contained in:
2026-11-18 14:49:56 +01:00
parent 29568fab6c
commit 42a6b6533f
4 changed files with 24 additions and 6 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
"""An epic held in memory, for do-epic's tests, held to contract.py like every backend."""
import dataclasses
from do_epic.backend.protocol import EpicIssue, no_child, no_parent, unfit
from do_epic.backend.protocol import EpicIssue, no_child, no_parent, unfit, unfit_label
from failure import Failure
@@ -31,7 +31,7 @@ class MemoryEpic:
def add_label(self, key: str, label: str) -> None | Failure:
if self.fails:
return Failure(self.fails)
if refused := unfit("-", (label,)):
if refused := unfit_label(label):
return refused
child = next((issue for issue in self.issues if issue.key == key and issue.parent == self.epic_key), None)
if child is None:
+2 -2
View File
@@ -6,7 +6,7 @@ import typing
from adf_codec.convert import adfs_to_markdown, markdown_to_adf, Refused
from atlassian.client import basic_auth, Http, jira_json, ToAdf, ToMarkdown
from project_config.settings import Epic
from do_epic.backend.protocol import EpicIssue, no_child, no_parent, unfit
from do_epic.backend.protocol import EpicIssue, no_child, no_parent, unfit, unfit_label
from failure import Failure
from plan_store.jira_epic import ISSUE_KEY, ISSUE_TYPE, project_of, searched
@@ -80,7 +80,7 @@ class JiraEpic:
authorization = basic_auth(self.env_file)
if isinstance(authorization, Failure):
return authorization
if refused := unfit("-", (label,)):
if refused := unfit_label(label):
return refused
above = self.parent_of(key, authorization, "to label it")
if isinstance(above, Failure):
+5
View File
@@ -51,6 +51,11 @@ def unfit(summary: str, labels: tuple[str, ...]) -> Failure | None:
"""Why no tracker can file an issue with this summary and these labels; None where one can."""
if not summary.strip() or "\n" in summary:
return Failure("the summary must be one line of text")
return unfit_label(*labels)
def unfit_label(*labels: str) -> Failure | None:
"""Why no tracker can take one of these labels; None where one can."""
if bad := next((label for label in labels if not LABEL.fullmatch(label)), None):
return Failure(f"the label {bad!r} is empty or holds white space")
return None