feat(orchestrator): every entry that waits on the operator is a Match card
Match now builds asks, choices, decision rows and rule requests from the inbox items, beside commits and commands, so its card count follows the Tasks badge. A decision card shows its options with the recommended one marked; a pick is released with the same single passkey, and the hub posts the answer of a decision row to the row's agent itself and keeps the row off the stack until its question changes. A choice cannot be rejected; a rule card's accept opens its row, its reject carries the feedback. Every card shows the scores its text carries as labels, value included; outside a commit's score line only an emoji-led score counts. Answered decision rows leave the badge and show as answered in the inbox. Requirement 012 records the operator's amendment of 2026-11-19 and decision 11. 🎯 Fix: 92 % 💥 Break: 4 % 💸 Tokens: – ⏱️ Velocity: – 🛡️ Security: 100 % 🏆 Score: 88 🚦 Gate: ✅ 90/5, tokens and velocity <= 100, security 100 % Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
67cbe0ddd3
commit
c3dc1b8c58
13 files changed
+489
-55
No files matched your search
@@ -0,0 +1,168 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
import sys
|
||||
import time
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
from unittest import mock
|
||||
|
||||
HERE = Path(__file__).resolve().parent
|
||||
sys.path[:0] = [str(HERE.parent), str(HERE)]
|
||||
|
||||
import hub_e2e_kit as base
|
||||
from hub_case import HubCase
|
||||
from hub_support import ASK, OPTIONS, iso
|
||||
from kvb_orchestrator import batches, skill_scripts
|
||||
|
||||
OUT = Path(os.environ.get("E2E_OUT", "/tmp/hub-match-waiting-shots"))
|
||||
RELEASE_AT = 1366
|
||||
SCORED = "git commit -m 'feat: x' -m '🎯 Fix: 95 % · 💥 Break: 2 % · 💰 Value: 1:4 · 🏆 Score: 93'"
|
||||
PICK = "operator:operator/pick"
|
||||
FRONT = """(async () => {@HELPERS@
|
||||
const card = () => document.querySelector("#main .match-card.front");
|
||||
if (!(await until(card, 8000))) {
|
||||
return {error: text(document.getElementById("main"))};
|
||||
}
|
||||
const peek = document.querySelector('#main .match-peek[data-card="@PICK@"]');
|
||||
if (peek) {
|
||||
peek.click();
|
||||
}
|
||||
const node = await until(() => (card() && card().dataset.card === "@PICK@" ? card() : null), 3000);
|
||||
return {front: node ? node.dataset.card : null, options: node ? all(".match-options .option", node).map((option) => [text(option.querySelector("strong")), option.classList.contains("recommended")]) : [],
|
||||
wide: document.documentElement.scrollWidth > window.innerWidth + 1};
|
||||
})()"""
|
||||
FLOW = """(async () => {@HELPERS@
|
||||
const posted = [];
|
||||
const send = window.fetch.bind(window);
|
||||
window.fetch = async (path, init) => {
|
||||
if (String(path) === "/api/inbox/approve") {
|
||||
posted.push(JSON.parse(init.body).items.map((item) => [item.kind, item.id, item.verb, item.label, item.channel || null, item.reason || null]));
|
||||
}
|
||||
return send(path, init);
|
||||
};
|
||||
const card = () => document.querySelector("#main .match-card.front");
|
||||
if (!(await until(card, 8000))) {
|
||||
return {error: text(document.getElementById("main"))};
|
||||
}
|
||||
const key = (name) => document.body.dispatchEvent(new KeyboardEvent("keydown", {key: name, bubbles: true, cancelable: true}));
|
||||
const seen = {};
|
||||
for (let step = 0; step < 8 && card(); step += 1) {
|
||||
const node = card();
|
||||
const id = node.dataset.card;
|
||||
const acts = Object.fromEntries(all("#main .match-actions .match-act").map((button) => [text(button.querySelector(".match-act-label")), button.disabled]));
|
||||
seen[id] = {kind: node.dataset.kind, chips: all(".match-metric", node).map((chip) => `${chip.dataset.metric}=${text(chip.querySelector("strong"))}`), acts,
|
||||
options: all(".match-options .option", node).map((option) => text(option.querySelector("strong"))), rule: Boolean(node.querySelector(".rule-request")), command: text(node.querySelector(".match-command"))};
|
||||
if (id.startsWith("operator:")) {
|
||||
node.querySelector(".match-options .option:not(.recommended)").click();
|
||||
} else if (id.startsWith("decision:")) {
|
||||
key("ArrowLeft");
|
||||
seen[id].refused = Boolean(await until(() => all("#toasts .toast").map(text).find((entry) => entry.startsWith("Reject: not possible")), 3000));
|
||||
node.querySelector(".match-options .option").click();
|
||||
} else if (id.startsWith("ask:")) {
|
||||
key("ArrowRight");
|
||||
} else {
|
||||
key("ArrowRight");
|
||||
seen[id].sheet = Boolean(await until(() => document.querySelector(".sheet-box .rule-request"), 3000));
|
||||
document.querySelector(".sheet-box .sheet-head button").click();
|
||||
await sleep(200);
|
||||
seen[id].stayed = card() && card().dataset.card === id;
|
||||
key("ArrowLeft");
|
||||
const feedback = await until(() => document.querySelector(".sheet-box .match-feedback"), 3000);
|
||||
feedback.value = "too broad";
|
||||
document.querySelector(".sheet-box .match-feedback-reject").click();
|
||||
}
|
||||
await until(() => !card() || card().dataset.card !== id, 3000);
|
||||
}
|
||||
const overview = await until(() => document.querySelector("#main .match-overview"), 3000);
|
||||
const rows = overview ? all("#main .match-decision").map((item) => [item.dataset.card, item.dataset.verdict, text(item.querySelector(".match-verdict"))]) : [];
|
||||
const found = {seen, rows, wide: document.documentElement.scrollWidth > window.innerWidth + 1};
|
||||
if (@RELEASE@) {
|
||||
document.querySelector("#main .match-release").click();
|
||||
found.toast = await until(() => all("#toasts .toast").map(text).find((entry) => entry.startsWith("Release")), 15000);
|
||||
found.emptied = Boolean(await until(() => document.querySelector("#main .match-stack .empty"), 15000));
|
||||
found.posted = posted;
|
||||
}
|
||||
return found;
|
||||
})()"""
|
||||
|
||||
|
||||
@unittest.skipUnless(shutil.which(os.environ.get("CHROMIUM", "chromium")), "no Chromium")
|
||||
class TestMatchWaiting(HubCase):
|
||||
drive = base.OrchestratorE2ECase.drive
|
||||
authenticator = base.OrchestratorE2ECase.authenticator
|
||||
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
now = time.time()
|
||||
self.write_council({
|
||||
"work/s1/claim.json": {"office": "work/s1", "session": "s1", "runtime": "claude", "name": "Skills session", "since": iso(now - 86400), "beat": now, "work": "match"},
|
||||
"rasci.json": {"operator/pick": {"title": "Merge the hub now?", "workdir": "/repo", "description": "the gate is green", "check": "decision", "options": OPTIONS, "recommended": "Merge now", "roles": {"Skills": "A", "Operator": "R"}}},
|
||||
})
|
||||
self.ask = self.create_ask({**ASK, "command": SCORED, "timeout": 600})
|
||||
decided = self.tool("decision_request", {"question": "Name the release?", "options": OPTIONS, "agent": "Skills", "recommended": ""})
|
||||
self.assertFalse(decided["isError"], decided)
|
||||
self.choice = decided["structuredContent"]["id"]
|
||||
rule = {"kind": "ask", "tool": "Bash", "pattern": "make test*", "scope": "/repo*", "expires": int(now) + 86400, "agent": "Skills", "why": "the gate runs make test"}
|
||||
requested = self.tool("rule_request", rule)
|
||||
self.assertFalse(requested["isError"], requested)
|
||||
self.rule = requested["structuredContent"]["id"]
|
||||
|
||||
def radio(self) -> list[list[str]]:
|
||||
return [args for script, args in self.scripts.calls if script == skill_scripts.RADIO]
|
||||
|
||||
def steps(self) -> list[dict]:
|
||||
OUT.mkdir(parents=True, exist_ok=True)
|
||||
steps = []
|
||||
for width, height in sorted(base.WIDTHS, key=lambda size: size[0] == RELEASE_AT):
|
||||
url = f"http://localhost:{self.port}/?{width}#tasks/match"
|
||||
front = FRONT.replace("@HELPERS@", base.HELPERS).replace("@PICK@", PICK)
|
||||
flow = FLOW.replace("@HELPERS@", base.HELPERS).replace("@RELEASE@", "true" if width == RELEASE_AT else "false")
|
||||
steps.append({"width": width, "height": height, "url": url, "wait": 1500, "probe": front, "shot": str(OUT / f"chromium-{width}-decision.png")})
|
||||
steps.append({"width": width, "height": height, "url": url, "wait": 1500, "probe": flow, "shot": str(OUT / f"chromium-{width}-overview.png")})
|
||||
return steps
|
||||
|
||||
def check_flow(self, found: dict) -> None:
|
||||
self.assertNotIn("error", found, found)
|
||||
seen = found["seen"]
|
||||
ask, choice, rule = f"ask:{self.ask}", f"decision:{self.choice}", f"rule:{self.rule}"
|
||||
self.assertEqual(sorted(seen), sorted([PICK, ask, choice, rule]), found)
|
||||
self.assertEqual({card_id: entry["kind"] for card_id, entry in seen.items()}, {PICK: "decision", ask: "ask", choice: "decision", rule: "rule"})
|
||||
self.assertEqual(seen[ask]["chips"], ["fix=95 %", "break=2 %", "score=93", "value=1:4"], found)
|
||||
self.assertEqual(seen[ask]["command"], SCORED)
|
||||
self.assertEqual((seen[PICK]["options"], seen[PICK]["acts"]["Accept"], seen[PICK]["acts"]["Reject"]), (["Merge now", "Wait"], False, False), found)
|
||||
self.assertEqual((seen[choice]["acts"]["Accept"], seen[choice]["acts"]["Reject"], seen[choice]["refused"]), (True, True, True), found)
|
||||
self.assertEqual((seen[rule]["rule"], seen[rule]["sheet"], seen[rule]["stayed"]), (True, True, True), found)
|
||||
expected = [[PICK, "accept", "Accept: Wait"], [ask, "accept", "Accept"], [choice, "accept", "Accept: Merge now"], [rule, "reject", "Reject"]]
|
||||
self.assertEqual(sorted(found["rows"]), sorted(expected), found)
|
||||
self.assertFalse(found["wide"], found)
|
||||
|
||||
def test_chromium_decides_every_waiting_kind_and_releases_them_with_one_signature(self):
|
||||
with mock.patch.object(batches, "UNDO", 0.3):
|
||||
data = self.drive(self.steps(), self.authenticator(), "cdp.mjs", os.environ.get("CHROMIUM", "chromium"))
|
||||
self.settle(lambda: self.ask_status(self.ask, "0") == "allowed")
|
||||
(OUT / "chromium-waiting.json").write_text(json.dumps(data, indent=1), encoding="utf-8")
|
||||
self.assertEqual([error for error in data["errors"] if "(style-src-elem)" not in error and "/favicon.ico" not in error], [])
|
||||
fronts, flows = data["results"][0::2], data["results"][1::2]
|
||||
for front in fronts:
|
||||
with self.subTest(front=front):
|
||||
self.assertEqual((front["front"], front["options"], front["wide"]), (PICK, [["Merge now", True], ["Wait", False]], False), front)
|
||||
for found in flows:
|
||||
with self.subTest(release="toast" in found):
|
||||
self.check_flow(found)
|
||||
released = flows[-1]
|
||||
self.assertTrue(released["toast"].startswith("Release: 4 decisions"), released)
|
||||
self.assertTrue(released["emptied"], released)
|
||||
items = sorted(released["posted"][0])
|
||||
self.assertEqual(items, sorted([["operator", "operator/pick", "approve", "Wait", None, None], ["ask", self.ask, "approve", "", None, None], ["decision", self.choice, "approve", "Merge now", None, None], ["rule", self.rule, "reject", "", "call", "too broad"]]))
|
||||
self.settle(lambda: len(self.radio()) == 3)
|
||||
told = sorted(sent[-1].split("] ", 1)[1] for sent in self.radio())
|
||||
self.assertEqual(told[1], "Decision operator/pick Answer: Wait")
|
||||
self.assertTrue(told[0].startswith(f"Choice for decision {self.choice} ") and told[2].startswith("Denied by the operator: rule request"), told)
|
||||
self.assertEqual(self.tool("decision_wait", {"id": self.choice, "timeout_seconds": 0})["structuredContent"]["choice"], "Merge now")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
+83
-9
@@ -12,12 +12,14 @@ from pathlib import Path
|
||||
from unittest import mock
|
||||
|
||||
from hub_case import HubCase
|
||||
from hub_support import APPROVAL, GIT_ENV, HUB, REPO_ROOT, key, signing
|
||||
from hub_support import APPROVAL, ASK, GIT_ENV, HUB, OPTIONS, REPO_ROOT, key, signing
|
||||
from kvb_orchestrator import batches, payloads, scores, skill_scripts
|
||||
|
||||
MATCH = REPO_ROOT / "skills" / "kvb-match" / "scripts" / "match.py"
|
||||
CLIENT = HUB / "client"
|
||||
FEEDBACK = "app.py:2: name it after what it holds\nnotes.md:3: say why"
|
||||
PICK = {"title": "Merge the hub now?", "workdir": "/repo", "description": "the gate is green", "check": "decision", "options": OPTIONS, "recommended": "Merge now", "roles": {"Skills": "A", "Operator": "R"}}
|
||||
SCORED = "git commit -m 'fix 2 tests' -m '🎯 Fix: 95 %\n💥 Break: 2 %\n💰 Value: 1:4\n🏆 Score: 93'"
|
||||
TOLD = "app.py:2: name it after what it holds notes.md:3: say why"
|
||||
|
||||
|
||||
@@ -344,9 +346,10 @@ class TestCommandCards(MatchCase):
|
||||
self.assertFalse(fresh["stale"], fresh)
|
||||
self.assertIn("swapped", next(entry["content"] for entry in fresh["files"] if entry["path"].endswith("body.md")))
|
||||
|
||||
def test_decision_rows_and_rows_at_the_runner_are_no_cards(self):
|
||||
self.write_council({"rasci.json": {"operator/pick": {"title": "-", "workdir": str(self.work), "check": "decision", "roles": {"Operator": "R"}}}})
|
||||
self.assertEqual(self.cards(), [])
|
||||
def test_a_command_card_shows_the_scores_its_command_carries_with_their_emoji_only(self):
|
||||
self.operator_row("operator/commit", SCORED, str(self.work))
|
||||
chips = [(chip["id"], chip["value"]) for chip in self.card("operator:operator/commit")["metrics"]]
|
||||
self.assertEqual(chips, [("fix", "95 %"), ("break", "2 %"), ("score", "93"), ("value", "1:4")])
|
||||
|
||||
def test_show_prints_the_command_and_its_payload(self):
|
||||
command = self.payload_command()
|
||||
@@ -358,6 +361,75 @@ class TestCommandCards(MatchCase):
|
||||
self.assertIn(words, shown.stdout)
|
||||
|
||||
|
||||
class TestWaitingCards(MatchCase):
|
||||
def radio(self) -> list[list[str]]:
|
||||
return [args for script, args in self.scripts.calls if script == skill_scripts.RADIO]
|
||||
|
||||
def answered(self, task: str) -> str:
|
||||
return next(item["answered"] for item in self.snapshot()["inbox"] if item["id"] == task)
|
||||
|
||||
def waiting(self) -> dict[str, str]:
|
||||
self.claim("s1", "Skills session")
|
||||
self.add(staged_repo(self.work))
|
||||
self.write_council({"rasci.json": {"operator/pick": PICK, "operator/ship": {"title": "make ship", "workdir": str(self.work), "check": "done", "roles": {"Skills": "A"}}}})
|
||||
rule = {"kind": "ask", "tool": "Bash", "pattern": "make test*", "scope": "/repo*", "expires": int(time.time()) + 86400, "agent": "Skills", "why": "the gate runs make test"}
|
||||
requested = self.tool("rule_request", rule)
|
||||
self.assertFalse(requested["isError"], requested)
|
||||
return {"ask": self.create_ask({**ASK, "command": SCORED}), "decision": self.decision("Merge now"), "rule": requested["structuredContent"]["id"]}
|
||||
|
||||
def test_every_entry_that_waits_on_the_operator_is_one_card_of_its_kind(self):
|
||||
ids = self.waiting()
|
||||
cards = self.cards()
|
||||
inbox = self.snapshot()["inbox"]
|
||||
self.assertEqual(sorted(card["id"] for card in cards), sorted(f"{item['kind']}:{item['id']}" for item in inbox))
|
||||
kinds = {card["id"]: (card["kind"], card["entry"]) for card in cards if "entry" in card}
|
||||
self.assertEqual(kinds, {f"ask:{ids['ask']}": ("ask", "ask"), f"decision:{ids['decision']}": ("decision", "decision"), "operator:operator/pick": ("decision", "operator"), f"rule:{ids['rule']}": ("rule", "rule")})
|
||||
pick = self.card("operator:operator/pick")
|
||||
self.assertEqual((pick["options"], pick["recommended"], pick["reason"], pick["agent"], pick["to"]), (OPTIONS, "Merge now", "the gate is green", "Skills", "Skills"))
|
||||
ask = self.card(f"ask:{ids['ask']}")
|
||||
self.assertEqual((ask["command"], ask["directory"], ask["files"]), (SCORED, "/repo", []))
|
||||
self.assertEqual([(chip["id"], chip["value"]) for chip in ask["metrics"]], [("fix", "95 %"), ("break", "2 %"), ("score", "93"), ("value", "1:4")])
|
||||
rule = self.card(f"rule:{ids['rule']}")
|
||||
self.assertEqual((rule["rule"]["pattern"], rule["reason"], rule["dry_run"]["days"]), ("make test*", "the gate runs make test", 7))
|
||||
|
||||
def test_a_picked_option_of_a_decision_row_is_signed_once_with_the_rest_posted_to_its_agent_and_leaves_the_stack(self):
|
||||
ids = self.waiting()
|
||||
pick = self.card("operator:operator/pick")
|
||||
entries = [
|
||||
{"kind": "operator", "id": "operator/pick", "verb": "approve", "label": "Wait", "sha256": pick["sha256"]},
|
||||
{"kind": "decision", "id": ids["decision"], "verb": "approve", "label": "Merge now", "sha256": ""},
|
||||
{"kind": "ask", "id": ids["ask"], "verb": "approve", "label": "", "sha256": ""},
|
||||
]
|
||||
answer = signing.message_item("Skills", "post", "Decision operator/pick\nAnswer: Wait", "", "", "")
|
||||
self.assertIn(signing.item_hash(answer), self.prepare(entries)["payload"]["items"])
|
||||
for bad, code in (({**entries[0], "label": "Later"}, 400), ({**entries[0], "payload": "0" * 64}, 400), ({**entries[0], "sha256": "0" * 64}, 409)):
|
||||
with self.subTest(bad=bad):
|
||||
self.assertEqual(self.post_json("/api/sign", {"items": [bad]}, self.guard(self.host))[0], code)
|
||||
with mock.patch.object(batches, "UNDO", 0.4):
|
||||
self.assertEqual(self.approve(entries, self.signed(entries, self.pin()))[0], 202)
|
||||
self.assertNotIn("operator:operator/pick", [card["id"] for card in self.cards()])
|
||||
self.settle(lambda: self.choice(ids["decision"]) == "Merge now" and self.ask_status(ids["ask"], "0") == "allowed")
|
||||
self.settle(lambda: any(sent[0] == "post" and sent[-1].endswith("Decision operator/pick Answer: Wait") for sent in self.radio()))
|
||||
sent = next(sent for sent in self.radio() if sent[-1].endswith("Answer: Wait"))
|
||||
self.assertEqual(sent[:5], ["post", "--to", "Skills session", "--session", "Operator"])
|
||||
self.assertNotIn((skill_scripts.RASCI, ["set", "operator/pick", "--status", "stopped"]), self.scripts.calls)
|
||||
self.assertEqual({card["kind"] for card in self.cards()}, {"commit", "command", "rule"})
|
||||
self.assertEqual(self.post_json("/api/sign", {"items": [entries[0]]}, self.guard(self.host))[0], 409)
|
||||
self.assertEqual(self.answered("operator/pick"), "Wait")
|
||||
self.write_council({"rasci.json": {"operator/pick": {**PICK, "title": "Merge the hub tonight?"}}})
|
||||
self.assertEqual((self.card("operator:operator/pick")["title"], self.answered("operator/pick")), ("Merge the hub tonight?", ""))
|
||||
|
||||
def test_a_rejected_decision_row_stops_and_its_agent_hears_the_question_and_the_feedback(self):
|
||||
self.waiting()
|
||||
pick = self.card("operator:operator/pick")
|
||||
entry = {"kind": "operator", "id": "operator/pick", "verb": "reject", "label": "", "sha256": pick["sha256"], "channel": "call", "reason": FEEDBACK, "to": pick["to"]}
|
||||
with mock.patch.object(batches, "UNDO", 0.05):
|
||||
self.assertEqual(self.approve([entry], self.signed([entry], self.pin()))[0], 202)
|
||||
self.settle(lambda: (skill_scripts.RASCI, ["set", "operator/pick", "--status", "stopped"]) in self.scripts.calls)
|
||||
self.settle(lambda: self.radio() != [])
|
||||
self.assertTrue(self.radio()[0][6].endswith(f"Denied by the operator: decision operator/pick: Merge the hub now? (from Skills). Reason: {TOLD}"), self.radio())
|
||||
|
||||
|
||||
class TestMergeCards(MatchCase):
|
||||
def merge_row(self) -> tuple[Path, str, str]:
|
||||
repo, target = merge_repo(self.work)
|
||||
@@ -438,18 +510,20 @@ class TestPayloadHash(unittest.TestCase):
|
||||
class TestMetricChips(unittest.TestCase):
|
||||
def test_score_lines_of_every_shape_give_one_chip_per_metric_in_label_order(self):
|
||||
labels = scores.score_labels(REPO_ROOT / "skills")
|
||||
line = scores.metric_chips("🎯 fix 94 % · 💥 break 4 % · 💸 tokens 100 % · ⏱️ velocity 100 % · 🛡️ security 100 % · 🏆 score 90", labels)
|
||||
line = scores.metric_chips("🎯 fix 94 % · 💥 break 4 % · 💸 tokens 100 % · ⏱️ velocity 100 % · 🛡️ security 100 % · 🏆 score 90", labels, True)
|
||||
self.assertEqual([(chip["id"], chip["emoji"], chip["label"], chip["value"]) for chip in line], [
|
||||
("fix", "🎯", "Fix", "94 %"), ("break", "💥", "Break", "4 %"), ("tokens", "💸", "Tokens", "100 %"),
|
||||
("velocity", "⏱️", "Velocity", "100 %"), ("security", "🛡️", "Security", "100 %"), ("score", "🏆", "Score", "90"),
|
||||
])
|
||||
block = scores.metric_chips("🎯 Fix: 85 %\n💥 Break: 5 %\n⏱ Speed: new\n🏆 Score: 81\n🚦 Gate: ⛔ fix 85 % < 90", labels)
|
||||
block = scores.metric_chips("🎯 Fix: 85 %\n💥 Break: 5 %\n⏱ Speed: new\n🏆 Score: 81\n🚦 Gate: ⛔ fix 85 % < 90", labels, True)
|
||||
self.assertEqual([(chip["id"], chip["value"]) for chip in block], [("fix", "85 %"), ("break", "5 %"), ("velocity", "new"), ("score", "81")])
|
||||
self.assertEqual([(chip["id"], chip["value"]) for chip in scores.metric_chips("Fix 92% Break 2.5%", labels)], [("fix", "92%"), ("break", "2.5%")])
|
||||
self.assertEqual([(chip["id"], chip["value"]) for chip in scores.metric_chips("Fix 92% Break 2.5%", labels, True)], [("fix", "92%"), ("break", "2.5%")])
|
||||
for text in ("", "looks good", "🎯 high", "prefix 90 %"):
|
||||
with self.subTest(text=text):
|
||||
self.assertEqual(scores.metric_chips(text, labels), [])
|
||||
self.assertEqual(scores.metric_chips("🎯 95 💥 3", None), [])
|
||||
self.assertEqual(scores.metric_chips(text, labels, True), [])
|
||||
self.assertEqual(scores.metric_chips("fix 2 tests, score 3 · 🏆 7", labels, False), [{"id": "score", "emoji": "🏆", "label": "Score", "value": "7"}])
|
||||
self.assertEqual([(chip["id"], chip["value"]) for chip in scores.metric_chips("💰 Value: 1:4 · 💰 2", labels, True)], [("value", "1:4")])
|
||||
self.assertEqual(scores.metric_chips("🎯 95 💥 3", None, True), [])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in new issue
Block a user