Return the updated ~/.claude.json from mark_trusted

This commit is contained in:
2026-09-29 10:24:57 +02:00
parent 53a3149b25
commit 4aaad015f6
4 changed files with 19 additions and 16 deletions
+10
View File
@@ -85,6 +85,16 @@ class Parse(unittest.TestCase):
self.assertIsNone(formats.parse("[1, 2]"))
class MarkTrusted(unittest.TestCase):
def test_returns_the_updated_config_and_leaves_the_one_it_was_handed(self):
config = {"other": 1, "projects": {"/a": {"hasTrustDialogAccepted": True}, "/b": {"kept": True}}}
handed = json.dumps(config)
self.assertEqual(formats.mark_trusted(config, ["/a", "/b", "/c"]), ({"other": 1, "projects": {"/a": {"hasTrustDialogAccepted": True}, "/b": {"hasTrustDialogAccepted": True, "kept": True}, "/c": {"hasTrustDialogAccepted": True}}}, ["/b", "/c"]))
self.assertEqual(json.dumps(config), handed)
self.assertEqual(formats.mark_trusted({}, ["/a"]), ({"projects": {"/a": {"hasTrustDialogAccepted": True}}}, ["/a"]))
self.assertEqual(formats.mark_trusted({"projects": {"/a": 1}}, ["/a"]), Failure('projects["/a"] is not an object'))
class Grounded(unittest.TestCase):
def test_every_verdict_must_quote_the_transcript(self):
def verdict(evidence):