Fix command-name substitution and rules move with duplicate at destination
ci / test (push) Waiting to run

This commit is contained in:
swaits committed 2026-12-02 11:49:32 -07:00
1 parent 6477fc66d2
commit cb442e7d6f
4 files changed
+17 -4

No files matched your search

+11
View File
@@ -4110,6 +4110,17 @@ cli.main(["tick"])
self.assertEqual(self.read(self.data, "rules", "user.md"), before)
self.assertFalse(os.path.exists(os.path.join(self.proj, ".sisi")))
def test_rules_move_succeeds_when_the_destination_already_has_the_line(self):
line = "- Duplicate destination rule stays once [owner 2026-11-20]"
self.user_file(line + "\n- Another user rule [retro 2026-11-21]\n")
other = self.project("other")
os.makedirs(os.path.join(other, ".sisi"), exist_ok=True)
proj_rules = self.write(os.path.join(other, ".sisi", "rules.md"), line + "\n")
rc, out, _ = self.sisi("rules", "move", "Duplicate destination rule", "project", "--project", other)
self.assertEqual(rc, 0, out)
self.assertEqual(self.read(self.data, "rules", "user.md"), "- Another user rule [retro 2026-11-21]\n")
self.assertEqual(self.read(proj_rules), line + "\n")
def test_move_prefers_the_exact_line_when_one_rule_is_a_prefix_of_another(self): # undo review A
self.user_file("- Check logs\n")
self.write(os.path.join(self.data, "rules", "core.md"), "- Check logs in CI\n")
+3 -2
View File
@@ -1,5 +1,5 @@
"""The plan: a dependency graph recorded before any work is handed out, and the hooks that hold the lead to it."""
import io, json, os, sys, unittest
import io, json, os, shutil, sys, unittest
from unittest import mock
try: # the module, not its class: its tests must not run twice
from tests import test_core
@@ -570,7 +570,8 @@ class Plan(unittest.TestCase):
rc, out, _ = self.hook("gate")
self.assertIn('"block"', out)
self.assertIn("nodes a, b are ready and not started", out)
self.assertIn("`sisi pick --node a` `sisi pick --node b`", out)
exe = "sisi" if shutil.which("sisi") else os.path.join(self.tmp, "lib", "current", "bin", "sisi")
self.assertIn("`%s pick --node a` `%s pick --node b`" % (exe, exe), out)
def test_gate_lets_the_turn_end_while_nodes_only_run(self):
self.ready_plan()