Hold the config's failure messages to their exact text
This commit is contained in:
@@ -86,8 +86,9 @@ class LoadTest(ConfigCase):
|
||||
reason = self.failure()
|
||||
for name in ("plan", "changelog", "principles"):
|
||||
self.assertIn(f"`{name}`", reason)
|
||||
self.assertNotIn("`decisions`", reason)
|
||||
self.assertIn("acme/config.toml", reason)
|
||||
file = self.home / ".claude-projects" / "acme" / "config.toml"
|
||||
settings = "plan, working-rules, decisions, score-anchors, comprehension-history, reading-cost, changelog, goals-and-audience, principles"
|
||||
self.assertEqual(reason, f"{file}: `plan` is missing; `changelog` is missing; `principles` is missing. The settings are {settings}.")
|
||||
|
||||
def test_every_fault_in_one_config_is_named_together(self) -> None:
|
||||
cases = {
|
||||
@@ -112,9 +113,8 @@ class LoadTest(ConfigCase):
|
||||
def test_two_configs_naming_one_checkout_fail_naming_both(self) -> None:
|
||||
self.write("acme", CLIENT)
|
||||
self.write("acme-copy", CLIENT)
|
||||
reason = self.failure()
|
||||
self.assertIn("acme/config.toml", reason)
|
||||
self.assertIn("acme-copy/config.toml", reason)
|
||||
projects = self.home / ".claude-projects"
|
||||
self.assertEqual(self.failure(), f"{projects}/acme/config.toml and {projects}/acme-copy/config.toml both name the checkout {self.checkout}; one config may")
|
||||
|
||||
def test_a_config_that_cannot_be_read_fails_whichever_checkout_asks(self) -> None:
|
||||
cases = {"not TOML": "checkout = ", "no checkout": 'plan = "folder:todo.md"\n', "a checkout that is not text": "checkout = 3\n", "a relative checkout": 'checkout = "code/acme"\n'}
|
||||
@@ -123,7 +123,10 @@ class LoadTest(ConfigCase):
|
||||
self.home = pathlib.Path(made).resolve()
|
||||
self.write("acme", CLIENT)
|
||||
self.write("broken", text)
|
||||
self.assertIn("broken/config.toml", self.failure())
|
||||
reason = self.failure()
|
||||
self.assertIn("broken/config.toml", reason)
|
||||
if case == "a relative checkout":
|
||||
self.assertTrue(reason.endswith(", not 'code/acme'"), reason)
|
||||
|
||||
def test_a_folder_with_no_config_is_skipped(self) -> None:
|
||||
self.write("acme", CLIENT)
|
||||
|
||||
Reference in New Issue
Block a user